An experienced software developer with a strong background in developing award-winning web and mobile applications for diverse clients with 6+ years of industry experience.
I will prefer to use create-react-hook instead because it will setup an example folder that you can deploy to GitHub pages. I once use it for a React hook for manipulating browser cookies.
Get, Set, Update and Delete Cookie using React Hooks.
@devhammed/use-cookie
Get, Set, Update and Delete Cookie using React Hooks.
Install
npm install --save @devhammed/use-cookie
Usage
importReactfrom'react'importReactDOMfrom'react-dom'importuseCookiefrom'@devhammed/use-cookie'const App = () => {
const [username, setUsername, deleteUsername] =useCookie('username', 'User')
return (
<section>
<h1>Hello {username}!</h1>
<p>Edit below input, Your name will be stored in a cookie. you can refresh this page to see how it persists.</p>
<inputtype='text'value={username}onChange={(e) =>setUsername(e.target.value)}
/>
<buttononClick={() =>deleteUsername()}
>
Delete Cookie
</button>
</section>
)
}
ReactDOM.render(<App />,
I will prefer to use
create-react-hook
instead because it will setup anexample
folder that you can deploy to GitHub pages. I once use it for a React hook for manipulating browser cookies.devhammed / use-cookie
Get, Set, Update and Delete Cookie using React Hooks.
@devhammed/use-cookie
Install
Usage
Hermanya / create-react-hook
🎣CLI for easily creating reusable react hooks.
create-react-hook
How and why I made this tool.
Features
cjs
andes
module formatsInstall
This package requires
node >= 4
, but we recommendnode >= 8
.Creating a New Hook
Answer some basic prompts about your module, and then the CLI will perform the following steps:
Development
Local development is broken into two parts (ideally using two tabs).
First, run rollup to watch your
src/
module and automatically recompile it intodist/
whenever you…Awesome! I didn't know create-react-hook. Thank you!