Skip to content

Instantly share code, notes, and snippets.

@chetanraj
Created October 8, 2020 10:04
Show Gist options
  • Save chetanraj/2a99c8824e7ab37864119a843090ba56 to your computer and use it in GitHub Desktop.
Save chetanraj/2a99c8824e7ab37864119a843090ba56 to your computer and use it in GitHub Desktop.
../pages/Create/index.js
import React from 'react';
import { useName } from '../logics/useName';
const Create = () => {
const { name, setName } = useName();
const onChange = e => {
setName(e.target.value);
};
return (
<div>
<span>{name}</span>
<input onChange={e => onChange(e)} value={name} />
</div>
);
};
export { Create };
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment