fix set initialValue

This commit is contained in:
Владислав Чикалкин 2020-09-04 11:47:46 +03:00
parent 6f376af9c3
commit 080406b167

View File

@ -13,7 +13,9 @@ export const useStoreValue = ({ computedValue, valueName }) => {
// get value from store
useEffect(() => {
if (!computedValue) {
setCurrentValue(sourceValue);
if (sourceValue !== undefined) {
setCurrentValue(sourceValue);
}
}
}, [computedValue, sourceValue]);