I am quite new to React and after going through some tutorials, I was trying the below code of mine.
I made one component, passed props to it from a store, on compo
If you would like to handle multiple inputs with one handler take a look at my approach where I'm using computed property
to get value of the input based on it's name.
import React, { useState } from "react";
import "./style.css";
export default function App() {
const [state, setState] = useState({
name: "John Doe",
email: "john.doe@test.com"
});
const handleChange = e => {
setState({
[e.target.name]: e.target.value
});
};
return (
);
}