Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
export default function() {
const [username, setUsername] = useStore('username', 'spyna', true)
const [textValue, setTextValue] = React.useState(username)
function onChange(event) {
setTextValue(event.target.value)
}
function onSubmit(event) {
event.preventDefault()
setUsername(textValue)
}
return (
<section>
<h3>
Set the value <em>"username"</em> in the store
</h3>
<form></form></section>
export default function() {
const [count, setCount, deleteCount] = useStore('count', 0)
return (
<section>
<h3>
Set the value <em>"count"</em> in the store
</h3>
<button> setCount(count - 1)}>Decrement - </button>
<span>{count}</span>
<button> setCount(count + 1)}>Increment + </button>
<button> deleteCount()}>Delete "count" from store</button>
</section>
)
}