fansunited-component-scaffold
v0.0.12
Published
This template provides a minimal setup to get you started developing React components for Fans United functionality.
Downloads
3
Readme
Fans United component library starter kit
This 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.
How to run the project
First, you'd need to download the dependencies from NPM:
npm install
Then to run it for development, you use:
npm run dev
To build a package for production, you run:
npm run build
This will export the JS files to /dist dir.
To publish the project to NPM, you run:
npm publish
Directory structure
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. TheIndex
component is the main component you'd need to work on
Styling
Our components depend on the JoyUI framework
Fans United SDK
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.