Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix incorrect React.useEffect() in App.tsx template #2850

Merged

Conversation

objectiveSee
Copy link
Contributor

@objectiveSee objectiveSee commented Nov 20, 2024

Describe your PR

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

  1. Running tsc test on the generated code would have caught this bad import.
  2. CI is failing for various reasons
  3. 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 test jest tests pass with new tests, if relevant
  • yarn lint eslint checks pass with new code, if relevant
  • yarn format:check prettier checks pass with new code, if relevant
  • README.md (or relevant documentation) has been updated with your changes
  • If this affects functionality there aren't tests for, I manually tested it, including by generating a new app locally if needed (see docs).

@objectiveSee objectiveSee changed the title Update app.tsx Fix incorrect React.useEffect() in App.tsx template Nov 20, 2024
@objectiveSee objectiveSee marked this pull request as ready for review November 20, 2024 22:47
Copy link
Contributor

@frankcalise frankcalise left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch, thanks!

@frankcalise frankcalise merged commit 2886487 into infinitered:master Nov 27, 2024
1 check passed
infinitered-circleci pushed a commit that referenced this pull request Nov 27, 2024
## [10.0.5](v10.0.4...v10.0.5) (2024-11-27)

### Bug Fixes

* **boilerplate:** remove interop definition for FlashList ([#2838](#2838) by [@frankcalise](https://github.com/frankcalise)) ([b368bcb](b368bcb))
* **boilerplate:** update app.tsx useEffect ([#2850](#2850) by [@objective](https://github.com/objective)See) ([2886487](2886487))
* **cli:** component generator template off in expo-router ([#2854](#2854) by [@frankcalise](https://github.com/frankcalise)) ([95f7642](95f7642))
* **cli:** include ajv in devDependencies for Expo Router and npm ([#2842](#2842) by [@coolsoftwaretyler](https://github.com/coolsoftwaretyler)) ([6baf76b](6baf76b))
@infinitered-circleci
Copy link

🎉 This PR is included in version 10.0.5 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants