“Lulus data antar halaman bereaksi” Kode Jawaban

React Pass Parameter ke halaman lain

<Link
  to={{
    pathname: "/page",
    data: data // your data array of objects
  }}
>
  
//in /page
  render() {
  const { data } = this.props.location
  return (
    // render logic here
  )
}
Duck Duck Go-ogle

Lulus data antar halaman bereaksi

//Using the <Link /> component:

<Link
  to={{
    pathname: "/page",
    state: data // your data array of objects
  }}
>

//Using history.push()

this.props.history.push({
  pathname: '/page',
    state: data // your data array of objects
})


//Using either of the above options you can now access data on the location
//object as per the below in your page component.

render() {
  const { state } = this.props.location
  return (
    // render logic here
  )
}
miletoo

Jawaban yang mirip dengan “Lulus data antar halaman bereaksi”

Pertanyaan yang mirip dengan “Lulus data antar halaman bereaksi”

Lebih banyak jawaban terkait untuk “Lulus data antar halaman bereaksi” di JavaScript

Jelajahi jawaban kode populer menurut bahasa

Jelajahi bahasa kode lainnya