All,
I've recently started using react-admin to build a small website, and was interested in getting a Drawer from material-ui implemented in the site. I've read the advanced tutorial for adding dialogs and drawers, and even borrowed the PostQuickPreviewButton from that article and tried to use in my code, however whenever I add <PostQuickPreviewButton /> to a view, I get the following error:
Invariant Violation: Could not find "store" in the context of "Connect(PostQuickPreviewButton)". Either wrap the root component in a <Provider>, or pass a custom React context provider to <Provider> and the corresponding React context consumer to Connect(PostQuickPreviewButton) in connect options.
I'm relatively new to React and react-admin, but my understanding is that the react-admin framework has a <Provider> (and I do see it in my React Developer Tools). It's probably something simple, but just can't see to resolve it. I can post code if needed, but really don't believe I'm doing anything out of the ordinary.
Thanks for your help
In playing with the tutorial referenced above, I found that updating some of the dependencies (most notably react-redux and redux-form) caused the same error I was encountering with my program. So after some further experimentation, I found the following dependencies worked with react-admin :
"react": "^16.7.0",
"react-admin": "^2.6.2",
"react-dom": "^16.7.0",
"react-redux": "^5.1.1",
"react-router-dom": "^4.3.1",
"react-scripts": "2.1.3",
"redux-form": "^7.4.2",
"redux-saga": "^1.0.0"
Hope this saves folks some time
Related
native developers. I have been developing and maintaining a react-native app for the past four years now. Now I have come to a point where I no longer know a way to debug my app. I am using recent versions of both react-native-reanimated and #react-native-firebase for stability and feature requirements. Both of these libraries have limitations on debugging.
react-native-reanimated uses Turbo Modules and breaks debugging react-native with chrome tools and the great react-native-debugger.
#react-native-firebase above v15.x now requires us to have use_frameworks! in our Podfile which breaks Flipper debugging.
Without these options for debugging, what is left? Is anyone in the same situation and has a solution to debug their react-native app and view their redux state?
I appreciate the help.
My current versions in my app:
"#react-native-firebase/app": "15.5.0",
"react": "18.1.0",
"react-native": "0.70.5",
"react-native-reanimated": "^2.13.0",
I am developing a web app with react native for web, and I want to scan qrcode but it does not work, without errors.
I put the codes on snack, ran it on mobile with Expo Go, it worked perfectly. However, when I published it on github web, and open it with mobile browser (iOS Safari), the camera worked normally, but no qrcode was read (just no reponse when I put a qrcode inside).
Code info:
I referred sample code on expo-camera and expo-barcode-scanner. Since expo-barcode-scanner does not support web, I imported expo-camera only.
Version info:
"expo": "~42.0.1"
"expo-camera": "~11.2.2"
"expo-status-bar": "~1.0.4"
"react": "16.13.1"
"react-dom": "16.13.1"
"react-native": "https://github.com/expo/react-native/archive/sdk-42.0.0.tar.gz"
"react-native-web": "~0.13.12"
Also, I checked this issue, and tried the followings:
open /node_modules/expo-camera/package.json, set "#koale/useworker" to "4.0.1"
run npm i under root dir
open /node_modules/expo-camera/node_modules/#koale/useworker/package.json, confirmed that the version is 4.0.1
But it still did not work.
I feel confused now, did I take wrong solutions? Is there any workarounds?
Any suggestions would be appreciated.
I am developing an app using React-Native, and I need to add a background service to check notifications. And I have tried almost all the solutions including Headless JS in the internet and I still couldn't make it. Maybe I’m doing it in a wrong way. Can anybody suggest me anything?
(Even when the app is not open)
There are many packages to use which will help you achieve this.
As you have not mentioned any of the used packages ill suggest some:
https://hackernoon.com/easy-os-background-tasks-in-react-native-bc4476c48b8a
https://www.npmjs.com/package/react-native-background-job
https://www.npmjs.com/package/react-native-background-task
I have used following packages for a Radio app in React native.
the following packages helped me achieve all the background related activites even when the app was minimized and another app was used(App running in background process).
"dependencies": {
"mobx": "^4.1.1",
"mobx-react": "^5.0.0",
"native-base": "^2.11.0",
"react": "16.6.3",
"react-native": "0.58.6",
"react-native-gesture-handler": "^1.0.15",
"react-native-swift": "^1.2.2",
"react-native-track-player": "^1.1.2",
"react-navigation": "^3.3.0"
},
Info:
"react-native": "0.42.3"
"react-native-ble-manager": "3.1.2",
"react-native-camera": "0.12.0",
"react-native-datepicker": "1.4.5",
"react-native-default-preference": "^1.3.1",
Suddenly my android project does not work, the error is method does not override or implement a method from a supertype in all third party libraries.
But yesterday everything works fine, I have not changed anything. Is there anyone can tell me how to solve this problem. Thanks!
Finally, I find it in github, someone made mistake, https://github.com/facebook/react-native/issues/19272
Just downloaded the newest version of Expo XDE(2.20.1) and trying to convert an existing react native project into it. I followed precisely these steps, and when opening the app in Expo client on a real device, I got an error saying:
undefined is not an object (evaluating 'nativeVersion.major')
The problem happens both on Android and iOS.
Seems expo has a strict requirement of react/react-native versions, but unfortunately, I cannot find the version requirement list.
My current dependencies (which are quite up-to-date) are:
"react": "16.0.0",
"react-native": "0.49.3"
So, does this error indeed came from version conflicts? And if so, how do I solve the problem?
Your JS dependencies need to match the native code. With Expo SDK 21, which is based off of React Native 0.48, you can either use (recommended):
"react": "16.0.0-alpha.12",
"react-native": "https://github.com/expo/react-native/archive/sdk-21.0.2.tar.gz",
or:
"react": "16.0.0-alpha.12",
"react-native": "^0.48.4",
It's important you are careful with the versions when you update your dependencies. The upcoming React Native 0.49 (supported with Expo SDK 22) needs to use React 16.0.0-beta.5.
It might be easiest to create a new Expo project from scratch, then copy over your components. I've done this several times myself, and it's far easier than fighting whatever edge condition has affected you.
Remove your iOS build (./app/ios/build) folder and re-build.