Infinite Red's battle-tested React Native project boilerplate, along with a CLI, component/model generators, and more! 9 years of continuous development and counting.
MIT License
17.74k
stars
1.4k
forks
source link
Fix incorrect React.useEffect() in App.tsx template #2850
Updates Ignite to correctly use useEffect via the import, and not use if via React which isn't imported. This fixes a bug where the app doesn't run due to a bad import.
Testing
Running tsc test on the generated code would have caught this bad import.
CI is failing for various reasons
Locally, all test pass locally except the Expo Router one which seems to fail from a fresh commit of Ignite (eg. not the fault of my change).
yarn run v1.22.22
$ TS_JEST_DISABLE_VER_CHECKER=true jest test/vanilla/ignite-new-expo-router.test.ts
console.log
cd /private/var/folders/cm/0c8kbxtj2f58q876n_n9r5f00000gn/T/ignite-5d9f410c360ecd21ee1aa8a37cec6bf9 && node /Users/mememe/workspace/ignite/bin/ignite new Foo --debug --packager=bun --install-deps=true --experimental=expo-router --state=mst --yes && cd /Users/mememe/workspace/ignite exited with code 0
at ChildProcess.<anonymous> (test/_test-helpers.ts:83:15)
FAIL test/vanilla/ignite-new-expo-router.test.ts (54.164 s)
ignite new with expo-router
ignite new Foo --debug --packager=bun --install-deps=true --experimental=expo-router --state=mst --yes
✓ should convert to Expo Router with MST (2 ms)
✕ should pass test, lint, and compile checks (9421 ms)
ignite new Foo --debug --packager=bun --install-deps=false --experimental=expo-router --state-none --yes
✓ should convert to Expo Router without MST
● ignite new with expo-router › ignite new Foo --debug --packager=bun --install-deps=true --experimental=expo-router --state=mst --yes › should pass test, lint, and compile checks
Command failed: cd /private/var/folders/cm/0c8kbxtj2f58q876n_n9r5f00000gn/T/ignite-5d9f410c360ecd21ee1aa8a37cec6bf9/Foo && bun run compile && cd /Users/mememe/workspace/ignite
$ tsc --noEmit -p . --pretty
Please verify the following:
[ ] yarn testjest tests pass with new tests, if relevant
[x] yarn linteslint checks pass with new code, if relevant
[x] yarn format:checkprettier checks pass with new code, if relevant
[x] README.md (or relevant documentation) has been updated with your changes
[x] If this affects functionality there aren't tests for, I manually tested it, including by generating a new app locally if needed (see docs).
Describe your PR
Updates Ignite to correctly use
useEffect
via the import, and not use if viaReact
which isn't imported. This fixes a bug where the app doesn't run due to a bad import.Testing
tsc
test on the generated code would have caught this bad import.Please verify the following:
yarn test
jest tests pass with new tests, if relevantyarn lint
eslint checks pass with new code, if relevantyarn format:check
prettier checks pass with new code, if relevantREADME.md
(or relevant documentation) has been updated with your changes