In the above, if any change in the input corresponding state will be updated.
- Next, we will make the onSubmit action.
handleSubmit(event) {
event.preventDefault();
}
{10/12}
In this example, we do not want any action to take place on submitting so we use the "event.preventDefault();" method which says that no action on submitting.
{11/12}
- Now we will write the form element.
see the snippet.
--> onSubmit={this.handleSubmit} this action call to handleSubmit function.
--> value={this.state.value} this action will keep the input.
--> onChange={this.handleChange} this action will call to handleChange.
{12/12}
⭐️ complete code snippets for reference purposes.
If you like this make sure to:
Follow me @tejinder_id for web development-related tweets.
Thank you so much for staying to the end of this thread.
• • •
Missing some Tweet in this thread? You can try to
force a refresh
- We will use the main properties of CSS i.e Flex and inline-flex.
A thread 🧵
1. First, we will make an HTML structure.
- We are taking 3 icons.
2. Next, we will make the container a flex.
-> To make the gap between icons we use justify-content: space-between.
--> Width and max-width mean the container will not be larger than max-width and if the width is less than the max-width then the container width will be 80%.