Migrating my vue application into react. In vue 2, using a v-model on a component was an equivalent of passing a value prop and emitting an input event.
If we wanted to change prop or event names to something different, we would need to add a model option to ChildComponent component.
Here is my vue child component:
export default {
model: {
prop: 'checked',
event: 'change'
},
props: {
value: String,
checked: {
type: [Boolean, String, Array],
},
}
}
In Parent component i am using like this.
<ChildComponent :checked="SelectedFiles" />
I want to know how to handle this pattern in react hooks. I am not that much familiar with react. Any guidance will be helpful for me.
Via Active questions tagged javascript - Stack Overflow https://ift.tt/rmVtDCE
Comments
Post a Comment