Can't Import children to Deck to Component
See original GitHub issueI wanted to modularize my presentation so I did something like this:
<Deck { ...deckProps }>
<CustomSlideComponent /> // a wrapper for <Slide />
</Deck>
But this throws an error: warning.js:45 Warning: Failed propType: Invalid prop children
supplied to Deck
, expected a ReactNode. Check the render method of Connect(Deck)
.
I’m using Redux
but it doesn’t seem like thats the issue.
If I simply nest a Slide
and accopmanying children, there is no error.
Issue Analytics
- State:
- Created 8 years ago
- Reactions:7
- Comments:8 (4 by maintainers)
Top Results From Across the Web
[BUG] Can't import the named export 'Children' from ... - GitHub
1. Read the FAQs 2. Describe the bug ./node_modules/framer-motion/dist/es/components/AnimatePresence/index.mjs Can't import the named ...
Read more >React Redux: Connected child component not receiving props
I can't seem to figure out what the issue is. I have a component called DisplayItems that gets some data from an API...
Read more >DeckGL (React Component)
Child components are often maps (e.g. the StaticMap component from react-map-gl), but can be any React components. import DeckGL from '@deck.gl/react'; ...
Read more >Emulating standalone components using single component ...
SCAMs (single component Angular modules) can emulate standalone ... If we had widget module imports used by the child components such as ...
Read more >Parent, child and sibling relationships – Figma Help Center
Click the arrow next to a Frame, Group, or Component to view any child layers. Can't see the layer highlight on hover? Adjust...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I wanted to cut my presentation into smaller parts as well and bumped from the same problem. I found a nice solution here: https://github.com/MarkRedeman/mutation-testing-in-php/blob/master/src/slidify.js (all the credits go to @MarkRedeman) and used it in my presentation as well: https://github.com/dumbNickname/summit2016-react-redux . Maybe spactacle could expose such a utils function (probably it would be easier to maintain than some children lookup logic). Hope it helps!
I had the same issue. Was surprised that someone was able to make React Components not support Components. This is not an easy thing to break! :insert smiley face here:
The following allows you to split up the code base and include where required. As the code needs a given Type (For example a Slide) if the Component is not of this type (or implements the expected members) then the code dies. It doesn’t handle this gracefully.
This is a little poor as I would like to use this for a lot of presentations as the idea is sound. However, I don’t want lots of JS projects with slides copied and pasted.
https://gist.github.com/gpltaylor/d0e6a25bcacc00dddda19295a7eb2dd1