This template provides a minimal setup to get you started developing React components for Fans United functionality.
npm install fansunited-component-either-orThis template provides a minimal setup to get you started developing React components for Fans United functionality.
You can fork this repo, create a component and publish it to NPM for use in other projects.
First, you'd need to download the dependencies from NPM:
``bash`
npm install
Then to run it for development, you use:
`bash`
npm run dev
To build a package for production, you run:
`bash`
npm run build
This will export the JS files to /dist dir.
To publish the project to NPM, you run:
`bash`
npm publish
Your code sits in the src dir. Here you will find:
- main.tsx - The entry point for the applicationApp.tsx
- - The top-level component that accepts all the propscore
- dir - Contains different files needed for the app - types, translations, etc.components
- dir - Where your code should live. The Index component is the main component you'd need to work on
Our components depend on the JoyUI framework
When in production the component will expect a fansUnitedSDK prop containing an instance of the Fans United SDK.
However, for development purposes, this is not a good approach. This is why, when in development, we are giving the developer the opportunity to define an SDK instance using env variables. Check the .env` file for details on which variables you need.