fix(useSheetValue): default value should be null not undefined

Fixes #393
This commit is contained in:
Matiss Janis Aboltins 2022-11-20 18:52:43 +00:00 committed by James Long
parent 4904da5006
commit 3133ddcda3

View file

@ -41,7 +41,7 @@ export default function useSheetValue(binding, onChange) {
let spreadsheet = useContext(SpreadsheetContext); let spreadsheet = useContext(SpreadsheetContext);
let [result, setResult] = useState({ let [result, setResult] = useState({
name: sheetName + '!' + binding.name, name: sheetName + '!' + binding.name,
value: binding.value, value: binding.value === undefined ? null : binding.value,
query: binding.query query: binding.query
}); });
let latestOnChange = useRef(onChange); let latestOnChange = useRef(onChange);