Listen to state to rerender children components.
npm install react-rerender-componentEnglish|繁體中文
Listen to state to rerender children components.
$ npm i react-rerender-component
`Import
`js
import Rerender from 'react-rerender-component'
`Example
`jsx
function ReactiveCount ({ count }) {
return {count}
}function UnreactiveCount ({ count: initCount }) {
const count = useState(initCount)[0]
return
}
`In general, when the external state is passed to the
ReactiveCount, it will be updated in time, but in UnreactiveCount exists a new state from the parent state, it can't rerender even if the external state is updated.`jsx
function App () {
const [count, setCount] = useState(0) return (
)
}
`Rerender` component available properties: