question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Can't Import children to Deck to Component

See original GitHub issue

I 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:closed
  • Created 8 years ago
  • Reactions:7
  • Comments:8 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
dumbNicknamecommented, Mar 23, 2016

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!

1reaction
gpltaylorcommented, Oct 2, 2016

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

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found