Parent does not update
See original GitHub issueHey,
In my Login Component I have the folowing code where I pass a field down to a specific input component. When I type in the input and submit the form, the email field returns undefined although I have a value.
Did I miss something here? Shouldn’t the parent get updated with the value?
<form onSubmit={form.onSubmit}>
<Input field={form.$('email')} />
</form>
Input.js
class Input extends React.Component {
render() {
const { field } = this.props;
return (
<div>
<div className={s.field}>
<input {...field.bind()} />
<label htmlFor={field.id}>
{field.label}
</label>
</div>
<p>{field.error}</p>
</div>
);
}
}
Issue Analytics
- State:
- Created 6 years ago
- Comments:8 (4 by maintainers)
Top Results From Across the Web
Returning data from a Window does not update the parent
The issue arises from the way UI re-rendering works. When the Window is in a separate component, UI updates only happen in that...
Read more >Parent State not updating when passed data from child ...
I'm trying to create a note-taking application in React. The application should add a new note when an "Add note" button is pressed...
Read more >Update parent's state from child component : r/reactjs - Reddit
Don't pass updateState down to the child component. What you should do instead is give the child component an onClick prop. Then the...
Read more >Child component not refreshing when updating data from ...
allorders is coming back with new data, Child LWC data table is not being update with new data. I do not have a...
Read more >Child component doesn't update on parent change - Help
The CarIndex component show a list of cars and the CarEdit component is used to update the model Car. <!-- CarIndex --> <table>...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
fixed it?
@foxhound87 It should have certain sequence, I have ended up with below (
typescript
)export default (withStyles as any)(styles)(observer(MyComponent))