don't call localStorage on server

This commit is contained in:
keyan 2022-01-07 20:05:00 -06:00
parent 41323883a5
commit e6c693f241
1 changed files with 2 additions and 2 deletions

View File

@ -127,10 +127,10 @@ function InputInner ({
if (overrideValue) {
helpers.setValue(overrideValue)
if (storageKey) {
localStorage.setItem(storageKey, overrideValue)
localStorage?.setItem(storageKey, overrideValue)
}
} else if (storageKey) {
const draft = localStorage.getItem(storageKey)
const draft = localStorage?.getItem(storageKey)
if (draft) {
// for some reason we have to turn off validation to get formik to
// not assume this is invalid