Skip to content

Instantly share code, notes, and snippets.

@EdwardGoomba
Created January 20, 2020 17:53
Show Gist options
  • Save EdwardGoomba/dc69ae7755dacd82ad26b43dcb9635ce to your computer and use it in GitHub Desktop.
Save EdwardGoomba/dc69ae7755dacd82ad26b43dcb9635ce to your computer and use it in GitHub Desktop.
React Use State Hook w / Handle Change for State
// example of stateless functional component using useState hooks
// example of multi use handleChange function implemented with hooks
const StatelessHandleChange = () => {
const [scheduleData, setScheduleData] = useState({
firstName: '',
lastName: '',
dob: '',
payer: '',
provider: '',
startTime: '',
endTime: '',
});
const handleChange = (event) => {
setScheduleData({ [event.target.name]: event.target.value });
};
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment