A React component interface to LocalStorage
This is a no frills example of using react-storehouse
for a user name.
<LocalStorageProvider
item="name"
render={(name = "Guest", update) => (
<h1>Hi {name}!</h1>
<input
onChange={e => update(e.target.value)}
type="text"
/>
)}
/>
npm i react-storehouse --save
or
yarn add react-storehouse
Exports ReactStorehouse
on window
.
<script
crossorigin
src="https://unpkg.com/react-storehouse"
></script>
Learn React open source, is intended for education. Source should be singularly focus and readable above all.
MIT License Copyright © Michael Chan 2017