Asosiy tarkibga o'tish

useGate

useGate(GateComponent, props)

Hook for passing data to Gate

Arguments

  1. GateComponent (Gate)
  2. props (Props)

Returns

(void)

Example

import {createGate, useGate} from 'effector-react'
import {Route} from 'react-router'

const Page = createGate('page')
Page.state.watch(({match}) => {
console.log(match)
})
const Home = props => {
useGate(Page, props)
return <section>Home</section>
}

const App = () => <Route component={Home} />