You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If you have `@babel/core` installed, also upgrade it to latest version.
@@ -77,7 +77,7 @@ If you have `@babel/core` installed, also upgrade it to latest version.
77
77
npm install --save-dev @babel/core
78
78
```
79
79
80
-
If upgrading the packages don't help, you can also try deleting your `node_modules` as well as lock the file and reinstall your dependencies.
80
+
If upgrading the packages don't help, you can also try deleting your `node_modules` and then the lock the file and reinstall your dependencies.
81
81
82
82
If you use `npm`:
83
83
@@ -95,6 +95,12 @@ rm yarn.lock
95
95
yarn
96
96
```
97
97
98
+
:::warning
99
+
100
+
Deleting the lockfile is generally not recommended as it may upgrade your dependencies to versions that haven't been tested with your project. So only use this as a last resort.
101
+
102
+
:::
103
+
98
104
After upgrading or reinstalling the packages, you should also clear Metro bundler's cache following the instructions earlier in the page.
99
105
100
106
## I'm getting "Module '[...]' has no exported member 'xxx' when using TypeScript
The `component` prop expects a React Component, but in the example, it's getting a functionreturning an React Element. While superficially a component and a functionreturning a React Element look the exact same, they don't behave the same way when used.
387
376
388
377
Here, every time the component re-renders, a new function will be created and passed to the `component` prop. React will see a new component and unmount the previous component before rendering the new one. This will cause any local state in the old component to be lost. React Navigation will detect and warn for this specific case but there can be other ways you might be creating components during render which it can't detect.
@@ -432,30 +421,6 @@ function App() {
432
421
433
422
Or when you use a higher order component (such as `connect` from Redux, or `withX` functions that accept a component) inside another component:
If you're unsure, it's always best to make sure that the components you are using as screens are defined outside of a React component. They could be defined in another file and imported, or defined at the top level scope in the same file:
0 commit comments