I have a useState as follows:
const [Total, setTotal] = useState(props.location.state.data.price)
I would like to have it so if props.location.state.data.price is defined, it renders, but if undefined, then it returns 0.
I've tried nullish coalescing operators but it is not working. Any help is appreciated. Thanks