What is the current behavior?
const [count, setCount] = useState(0)
const map = useMap([['count', 0]])
console.log('rerender')
return <>
<button type="button" onClick={() => setCount(0)}>Click state</button>
<button type="button" onClick={() => map.set('count', 0)}>Click map</button>
</>
Clicking on the "Click state" button multiple times in a row shows "rerender" only once in the console, whereas clicking on the "Click map" button shows it for every click.
Steps to Reproduce
See above.
What is the expected behavior?
It should behave like useState().
Environment Details
@react-hookz/web version: 25.1.1
react version: 18.3.21
react-dom version: 18.3.7
typescript version: -
- OS: macOS
- Browser: Chrome, Safari, and Firefox
- Did this work in previous versions? I don't know