Closed alexknipfer closed 7 years ago
Freactal passes props
and context
to initialState
, so it would just look like:
const wrapComponentWithState = provideState({
initialState: (props) => ({
testValue: props.value
})
})
Oh, perfect! Thanks so much!
What's the best way to initialize state to a specific prop value? Or, how do I access props within initialState? Obviously, using React's state you would just set the initial state to
this.props.value
, but what is the correct way to do so with freactal?For example: