Get the App
SLTechnology News&Howtos  ›  Development  › 

What is the function of native in the front end of web

Shulou Source: shulou.com Published: 2022-06-02 15:43:06 09月26日 Update

The main content of this article is to explain "what is the role of native in the front end of web". Interested friends may wish to take a look. The method introduced in this paper is simple, fast and practical. Next, let the editor take you to learn "what is the role of native in the front end of web"?

React-native implements the transfer of values between pages.

Using reactNavigation components

Compatibility: IOS/Android

Principle: reactNavigation mounts the navigation object on the props of the page, which can be used for routing jump. When doing the page jump, you can bring parameters / callback method to the target page, so as to achieve the purpose of passing parameters.

Switching routing method:

This.props.navigation.goBack () returns to the previous level

This.props.navigation.popToTop () returns to the top of the stack

This.props.navigation.push ('Details') continues to push down the new route, which is equivalent to a child page of a child page

This.props.navigation.navigate ('Details') pushes the new route to the navigator, or jumps to the page if it is not in the navigator

The parent page passes parameters to the child page

{

This.props.navigation.navigate ('Bamboo, {

Params:xx

})

}

} >

Subpage receive parameters

Constructor (props) {

Super (props)

Const {navigation} = this.props

Letyy=navigation.getParam ("params")

}

In this way, the page gets the value passed by the parent page.

ReactNative adds Redux support

Now the project environment is as follows:

{

"name": "app"

"version": "0.0.1"

"private": true

"scripts": {

"start": "react-nativestart"

"test": "jest"

"lint": "eslint."

}

"dependencies": {

"native-base": "^ 2.13.4"

"react": "16.8.6"

"react-native": "0.60.5"

"react-native-gesture-handler": "^ 1.3.0"

"react-native-keyboard-aware-scroll-view": "^ 0.9.1"

"react-native-reanimated": "^ 1.2.0"

"react-navigation": "^ 3.11.1"

}

At this point, I believe you have a deeper understanding of "what is the role of native in the front end of web?" you might as well do it in practice. Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!

Tags: Page routing function front end parameter method content navigator learning navigation practical deeper between interest compatibility principle stack practicality actual object Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Linux MySQL Shulou Technology macOS MariaDB