1
0
Fork 0

🐛 Fixed bool pattern option to hold value across renders

This commit is contained in:
Joost De Cock 2019-07-04 07:45:10 +02:00
parent 2a4c6b8656
commit 329e0f0ac8

View file

@ -4,7 +4,9 @@ import FormFieldBool from "../../.form/FormFieldBool";
import OptionPreamble from "../OptionPreamble";
const PatternOptionBool = props => {
const [value, setValue] = useState(props.dflt);
const [value, setValue] = useState(
props.value === null ? props.dflt : props.value
);
const [expanded, setExpanded] = useState(false);
const update = (name, newValue, evt) => {