Warning:` ListView is deprecated and will be removed in a future release
lc3t35 opened this issue · comments
Current Behavior
Displays a warning about ListView
Warning:` ListView is deprecated and will be removed in a future release. See https://fb.me/nolistview for more information
- node_modules/expo/build/environment/muteWarnings.fx.js:27:24 in error
- node_modules/raven-js/src/console.js:35:36 in <unknown>
- node_modules/react-native/node_modules/fbjs/lib/warning.js:30:18 in printWarning
- node_modules/react-native/node_modules/fbjs/lib/warning.js:51:23 in <unknown>
- node_modules/react-native/Libraries/Utilities/warnOnce.js:29:10 in warnOnce
- node_modules/react-native/Libraries/react-native/react-native-implementation.js:70:6 in ListView
- node_modules/react-native-masonry/components/Masonry.js:63:16 in Masonry
Possible Solution
See https://fb.me/nolistview for more information
Context (Environment)
expo sdk33 rn 0.59.8, react 16.8.3
This is not a warning it is an error so remove it as soon as possible.
+1
+1. still not working
npm install deprecated-react-native-listview;
import ListView from 'deprecated-react-native-listview';
This is my temporary solution
Following @jzyds solution, I used patch-package
to modify react-native-masonry
in node_modules
. Tested seems OK so far.
In your project folder:
yarn add deprecated-react-native-listview
yarn add --dev patch-package postinstall-postinstall
Add patch-package to your package.json postinstall script:
"scripts": {
"postinstall": "patch-package"
}
Edit /node_modules/react-native-masonry/components/Masonry.js
.
Remove ListView from 'react-native', replace with one from deprecated-react-native-listview:
-import { View, ListView, Image, Text, Dimensions } from 'react-native';
+import { View, Image, Text, Dimensions } from 'react-native';
+import ListView from 'deprecated-react-native-listview';
Save your modification as patch:
yarn patch-package react-native-masonry
Verify your modification applied:
yarn install --check-files
yarn
should restore react-native-masonry
, and after that patch-package
will kick in, applying your modification.
Done.
hey, I have the same problem!
Following @jzyds solution, I used
patch-package
to modifyreact-native-masonry
innode_modules
. Tested seems OK so far.In your project folder:
yarn add deprecated-react-native-listview yarn add --dev patch-package postinstall-postinstallAdd patch-package to your package.json postinstall script:
"scripts": { "postinstall": "patch-package" }Edit
/node_modules/react-native-masonry/components/Masonry.js
.
Remove ListView from 'react-native', replace with one from deprecated-react-native-listview:-import { View, ListView, Image, Text, Dimensions } from 'react-native'; +import { View, Image, Text, Dimensions } from 'react-native'; +import ListView from 'deprecated-react-native-listview';Save your modification as patch:
yarn patch-package react-native-masonryVerify your modification applied:
yarn install --check-files
yarn
should restorereact-native-masonry
, and after thatpatch-package
will kick in, applying your modification.Done.
Hey This solution works for the first time i use it them i have this error/Warning
Warning: Can't perform a React state update on an unmounted component. This is a no-op, but it indicates a memory leak in your application. To fix, cancel all subscriptions and asynchronous tasks in the componentWillUnmount method.
in Masonry (at App.js:89)
in RCTView (at View.js:34)
in View (at App.js:60)
in App (at renderApplication.js:45)
in RCTView (at View.js:34)
in View (at AppContainer.js:106)
in RCTView (at View.js:34)
in View (at AppContainer.js:132)
in AppContainer (at renderApplication.js:39)