How to make component observe on form data?
See original GitHub issueMy parent component includes a form
data as below:
render() {
const form = this.form;
return (
<div className="pt-dark ">
<form className="profile-form" onSubmit={form.onSubmit}>
<div className="profile-input-row">
<Input field={form.$('alias')}/>
</div>
<div className="profile-input-row">
<Input field={form.$('port')}/>
</div>
Below is the Input
component code:
export default observer(({field}) => (
<div >
<label htmlFor={field.id}>{field.label}</label>
<div className="input-content">
<input {...field.bind()} />
</div>
</div>
));
when I change the value of the input, my parent
component doesn’t got rendered. How can I make my current component listen on the form state change?
Issue Analytics
- State:
- Created 7 years ago
- Comments:10 (5 by maintainers)
Top Results From Across the Web
Sending form data - Learn web development | MDN
As we'd alluded to above, sending form data is easy, but securing an application ... The <form> element defines how the data will...
Read more >Different ways to get form data in Angular Component
1. Using formControlName (Reactive Form). Reactive forms provide a model-driven approach to handling form inputs whose values change over time.
Read more >Collecting Form Data using JavaScript - YouTube
In this lecture, you will learn how to collect form data of different input fields in HTML using JavaScript and DOM.
Read more >Angular 2/5 - Passing form data between components using ...
I have a form with multiple inputs and select menus etc and I'm trying to populate another form in another sibling component using...
Read more >Working with Form Data in React - DevCamp
onSubmit = fields => { const { title, body, image } = fields; var formData = new FormData(); formData.append('title', title); formData.append('body' ...
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
Yup, that should work. Thanks.
So why not creating another store? Then pass it with
@inject('store', 'form')