astoilkov / use-local-storage-state

React hook that persists data in localStorage
MIT License
1.1k stars 41 forks source link

Usage Example contains "ssr: true", which does not appear to be a valid option #53

Closed dkershner6 closed 2 years ago

dkershner6 commented 2 years ago

Main README

import useLocalStorageState from 'use-local-storage-state'

export default function Todos() {
    const [todos, setTodos] = useLocalStorageState('todos', {
        ssr: true, <---------------
        defaultValue: ['buy avocado', 'do 50 push-ups']
    })
}
astoilkov commented 2 years ago

🤦‍♂️

Fixed with https://github.com/astoilkov/use-local-storage-state/commit/5851612aac645a191f0bbb26acf5ccd8f02ef81e.

Only use-local-storage-state version 17 and below have this option. This is because for React 18 support there isn't a need for an option — it's automatic.

Thanks for reporting!