Home > Web Front-end > JS Tutorial > body text

Example of how react-router implements jump value transfer in JavaScript skills

黄舟
Release: 2017-05-28 10:31:38
Original
1541 people have browsed it

This article mainly introduces you to the relevant information about react-router's implementation of jumppassing value. The article gives detailed sample code, which is of certain significance to everyone. Referring to the value of learning, friends in need can follow the editor to learn together.

Preface

This article mainly introduces the relevant content about react-router jump value transfer, and shares it for your reference and study. Let’s take a look at the detailed introduction:

react-router jump value passing

1.Introduction package

import {hashHistory} from ‘React-router'
Copy after login

2. Jump to pass value

 handleClick = (value) => {
  hashHistory.push({
   pathname: 'message/detailMessage',
   query: {
    title:value.title,
    time:value.time,
    text:value.text
   },
  })
 }
Copy after login

3.Receive value

console.info(this.props.location.query.title)
console.info(this.props.location.query.time)
console.info(this.props.location.query.text)
Copy after login

Summary

The above is the detailed content of Example of how react-router implements jump value transfer in JavaScript skills. For more information, please follow other related articles on the PHP Chinese website!

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template