Home  >  Article  >  Web Front-end  >  Example of how react-router implements jump value transfer in JavaScript skills

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

黄舟
黄舟Original
2017-05-28 10:31:381529browse

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'

2. Jump to pass value

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

3.Receive value

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

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!

Statement:
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