Answer the question
In order to leave comments, you need to log in
Why can't child component connect to redux?
I have a component and if I call useSelector in it and display the store, then everything is fine, but for some reason such an error occurs in the child component, what is the reason for this?
I tried to wrap it in my provider separately, it doesn't help either
const PreviewCard = () => {
//useSelector здесь работает
return (
<div>
<PDFViewer style= {{width: '100%', height: '90vh'}}>
<MyDoc /> //Внутри этого компонента уже нет
</PDFViewer>
</div>
)
}
const MyDoc = () => {
const formStore = useSelector(state => state.pdfFormReducer)// тут и происходит ошибка
return (
<Document>
<Page size="A4" style={styles.page}>
<View style={styles.sectionHeader} fixed>
// тут просто формочки для pdf документа
</View>
</Page>
</Document>
)
}
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