Load previous soil variant selection during step navigation

This commit is contained in:
Dana Lambert 2021-10-20 13:14:12 +13:00
parent 6303bca92e
commit 2deb3faec0

View file

@ -20,9 +20,15 @@ const MESIC_SOIL_DESCRIPTION = (<p>
</p>); </p>);
export default function SoilSelector(props) { export default function SoilSelector(props) {
const [value, setValue] = React.useState(''); const [value, setValue] = React.useState(props.filters.soilVariant);
const [helperText, setHelperText] = React.useState('Please select your soil variant from the options above.'); const [helperText, setHelperText] = React.useState('Please select your soil variant from the options above.');
React.useEffect(() => {
if (props.filters.soilVariant) {
props.setNextDisabled(false);
}
});
const handleRadioChange = (event) => { const handleRadioChange = (event) => {
const soilVariantSelection = event.target.value; const soilVariantSelection = event.target.value;
setValue(soilVariantSelection); setValue(soilVariantSelection);