I have a react-native app which is working properly for a long time. But after something is happened, i don't know what it is, my app redux store data is not cleaning when i close the app.
Is someone here experiencing same problem? Am i doing something wrong?
By the way, the ios app is working fine. It's only in android.
I didn't share any code with you because everything was working fine before. If you want to take a look into code, just tell me.
Here is a video about my problem: https://streamable.com/wwbsh
From another question on stackoverflow.
However if the app is shut down, and the code re-runs it will be
loaded with your default redux state.
But my state is not loaded with my defaults.
Thank you.
"react": "16.3.1",
"react-redux": "^5.1.1",
"redux": "^4.0.1",
"redux-logger": "^3.0.6",
"redux-persist": "^5.10.0",
"redux-thunk": "^2.3.0",
After each app launch redux state should be reloaded with the defaults unless you're persisting your state using redux-persist
Related
Following along with this tutorial and specifically this chunk of code causes a complete freeze up of the UI however, only when I tap within the TextInput to type (no on screen keyboard even pops up). Otherwise, the code runs just fine so I suspect it has everything to do with this TextInput somehow.
I'm running this code on a Mac within an iPhone 13 iOS 15.4 simulator. This is an Expo managed project but while following these setup instructions, the only command that did not work for me was npx pod-install ios (the error I got was "CocoaPods is not supported in this project"). In looking this up I found this SO answer which top answer said "because you are building your React-Native project with Expo", so I figured it was okay to ignore but maybe this is causing the freeze up?
No errors appear in the console where I run npm start, and no warnings/errors show up in the simulator so I don't even really know what to google. The only thing I can do is force quit the app which brings up that the incident will be reported to Apple but that's it. Below are my dependencies from my package.json, thanks for any help ahead of time:
"dependencies": {
"#react-navigation/native": "^6.0.8",
"#react-navigation/native-stack": "^6.5.2",
"expo": "~44.0.0",
"expo-status-bar": "~1.2.0",
"react": "17.0.1",
"react-dom": "17.0.1",
"react-native": "0.64.3",
"react-native-safe-area-context": "3.3.2",
"react-native-screens": "~3.10.1",
"react-native-web": "0.17.1"
},
"devDependencies": {
"#babel/core": "^7.12.9"
},
I have a problem that I can't solve: I'm doing a development that has to be with this react and react-native versions
npmPackages:
react: 16.8.3 => 16.8.3
react-native: 0.59.9 => 0.59.9
To avoid warnings in the Apple Store by hand this works like a charm:
https://docs.google.com/document/d/1o-wTwf1R8606wF8VloGxccjOIdTmJC0hSYysFgasQ7g/edit
but i'm unable to do it programatically
https://www.gitmemory.com/issue/react-native-community/react-native-webview/819/532829030
https://github.com/react-native-community/react-native-webview/issues/819
As an alternative option and until I can use a correct version of react-native ... Could anyone tell me if is possible to generate my own implementation of react-native without UIWebView libraries? Could that be possible?
I mean, i'm unable to "clean" UIWebView in the post_install executing pod install. I would like to do a npm install but without UIWebView libraries, with a customized react-native 0.59.9 implementation.
Thank you very much in advance and greetings.
UPDATE
Is possible to define a folder in the package.json file? Something like
"dependencies": {
"#lingui/react": "^2.7.4",
"#react-native-community/async-storage": "^1.2.1",
"axios": "^0.18.0",
"base-64": "^0.1.0",
"expo": "^27.1.1",
"intl": "^1.2.5",
"jwt-decode": "^2.2.0",
"lodash": "^4.17.11",
"lottie-react-native": "^2.6.0",
"moment": "^2.24.0",
"react": "16.8.3",
"react-intl": "^2.8.0",
**"react-native": "mypath/my_0.59.9_react-native",**
PS It is the first time that I participate in Stackoverflow (although I have entered millions of times), I hope I have posed the question correctly.
Yes you can, I have done it with react-native 0.59.8 using patch-package.
What you need to do is:
Follow the instructions to install patch-package in your project.
Modify the react native Objective-c code and remove the UIWebView (for 0.59.8 I simply deleted the content of RCTWebView.h, RCTWebView.m, RCTWebViewManager.h and RCTWebViewManager.m).
Run the patch-package utility to create the patch and commit it to your repo.
For example, here are the patches that I created for react-native 0.59.8
Cheers!
I have built project react-native (on window) . When I connected device and run app ( react-native run-android) or reload app it just show blank-space, but if I pressed ctrl+S in visual code, app would fast refresh and run success.
If I disconnected device, app would show blank screen again. How do I run app success without connecting device ?
This is my version react-native
"dependencies": {
"#react-native-community/viewpager": "^2.0.2",
"firebase": "^7.2.3",
"react": "16.9.0",
"react-native": "0.61.3",
"react-native-gesture-handler": "^1.5.0",
"react-native-reanimated": "^1.4.0",
"react-native-screens": "1.0.0-alpha.23",
"react-native-swipe-gestures": "^1.0.4",
"react-native-swipeable": "^0.6.0",
"react-navigation": "^4.0.10",
"react-navigation-stack": "^1.10.3",
"realm": "^3.4.2",
"rn-fetch-blob": "^0.11.2"}
There are 3 ways :
1.) You have to build an APK of app from android, if you want to run the app without using react-native run-android command, but it would be a static app if you dont what to develop further.
2.) You can use hot refresh and hot reload.
3.) By using ADB connection.
I am guessing you are disconnecting your device, and hoping to see the same functionality without generating signed apk. Is that so?
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"
},
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