Answer the question
In order to leave comments, you need to log in
I send props, but I get the first object with all props, and all subsequent ones turn out to be empty objects, why is this happening?
I send a string and a function as props, but under the name of the first one, an object containing all props comes to the component, and instead of all subsequent ones, empty objects come, why is this happening, and how to fix it?
City is passed to value with string type:
export default function City() {
const dispatch = useDispatch()
const city = useSelector((state: TRootState) => state.city)
console.log('city type: ', typeof city) // Выводит string
return (
<div>
<Input value={city} onChange={onChangeHandlerWrapper(dispatch)}/>
</div>
)
}
export default function Input(value: any, onChange: any) {
console.log('value type:', typeof value) // А приходит object
return (
<input
type="text" value={value} onChange={onChange}
/>
)
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question