Also in the State example code, inside a class based component, you are returning direct HTML like :
State
return ( <div> <input value={this.state.userName} onChange= {this.onFilluserName} </div> );
Is it ok ? This code should be in another presentational component right ?
This is JSX. It can be done inside the same component or separately. I just tried to focus on logic here plus it covered the use of render.
Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink.
Hide child comments as well
Confirm
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Also in the
State
example code, inside a class based component, you are returning direct HTML like :return (
<div>
<input value={this.state.userName} onChange= {this.onFilluserName}
</div>
);
Is it ok ? This code should be in another presentational component right ?
This is JSX. It can be done inside the same component or separately. I just tried to focus on logic here plus it covered the use of render.