@henrybuilt/react-lib
v1.0.21
Published
## Development
Downloads
6
Readme
hb-react-lib
Development
Getting Started
cd ~/repos
git clone https://github.com/henrybuilt/hb-react-lib.git
cd ~/repos/hb-react-lib
npm i
Local development with npm link
cd ~/repos/hb-react-lib
npm link
npm run watch
, this will rebuild your ~/repos/hb-react-lib/dist as you make changes locallyrm -rf ./node_modules/react
, we remove the /react dir from ./node_modules to prevent conflicts with the target repo we wish to npm link withhb-react-lib
cd ~/repos/target-repo
, where "target-repo" is the repo in which you wish to use@henrybuilt/react-lib
npm link @henrybuilt/react-lib
Troubleshooting
If
npm run build
results inTypeError: Unknown file extension ".json"
, try the following:See this stack-overflow for more information.
Run
node --experimental-json-modules ./node_modules/.bin/rollup -c
If using
npm link
and you get the following error message in the repo where you're linking@henrybuilt/react-lib
,Uncaught TypeError: Cannot read properties of null (reading 'useState')
run the following commands in
hb-react-lib
directory:a.
rm -rf ./node_modules/react
b.rm -rf ./node_modules/react-dom
This can occur if you recently ran
npm i
insidehb-react-lib
.