Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to solve the problem of react link not jumping

2025-02-23 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/02 Report--

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!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report