How to solve the problem of react link not jumping
This article mainly introduces how to solve the problem of react link does not jump, has a certain reference value, interested friends can refer to, I hope you can learn a lot after reading this article, the following let the editor take you to understand it.
The solution for react link not to jump: 1. Close JS Remotely;2, add extra;3 to the root path route component, and pass TouchableOpacity as an attribute of the link component.
The operating environment of this paper: Windows7 system, react17.0.1, Dell G3.
React router native:link does not jump when clicked
Rn is embedded natively, and there is no response and no jump when clicking on the content of TouchableOpacity components.
/ / App.jsconst history = createMemoryHistory () / / Home.js {text} 1, close JS Remotely
For some reason, remote debugging causes TouchableOpacity to fail. Click to see the TouchableOpacity effect after closing, but still cannot jump.
2. Add extra// App.js / / extra to the root path route component
Because I am not familiar with rn development, at first I was worried about using createMemoryHistory, and then I was worried that the page jumped but was blocked, and so on.
Finally, I honestly went to github to find a basic project, looked for a difference little by little, and found that it was this neglected problem.
The principle is actually very simple, https://www.cnblogs.com/superlizhao/p/9280122.html.
I have this problem because router4.x reported to warning using multi-layer nested routing, but after adjusting it, it exposed the problem of not reading the principle carefully. I was ashamed.
3. Pass TouchableOpacity as an attribute of the link component to const linkParams = {pathname:'/ star', state: {data: item},}
There is something in it that will lead to no jump.
Thank you for reading this article carefully. I hope the article "how to solve the problem of react link not jumping" shared by the editor will be helpful to everyone. At the same time, I also hope that you will support us and pay attention to the industry information channel. More related knowledge is waiting for you to learn!