I have a component where I pass in data via props which is later used to render a flatlist. I'm trying to save the data to state but after setState, 'data' is printed as 'true' rather than the object array that is received via props.data.
Does anyone know why this happens?
const Slider = props => {
console.log('props data', props.data) // prints [{a: 1}, {b: 2}]
const [data, setData] = useState(props.data)
console.log('state data', data) // prints true
}
