props.children unavailable in stateless function
See original GitHub issueI have tried to migrate from React and most of it went really well.
For some reason though, children for one of my stateless function were being ignored. I can see that children
has worked fine in other places.
In this instance though, the child is only a text node (rather than fully blown JSX), so not sure if this is anything to do with it?
the code I’ve used is here : https://github.com/peter-mouland/react-lego/compare/master...preact#diff-6e90eca97c3fe0837836dfe4f8472197R3
Issue Analytics
- State:
- Created 7 years ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
props.children in react cannot be a stateless component?
As error says this.props.children is not a function or React Class(which is a function), instead it is an object created by invoking that ......
Read more >How to access props.children in a stateless functional ...
The {props. children} allows you to create a generic template, which can be modified by a parent when invoked. In this way, a...
Read more >What React Stateless Components are Missing - Jake Trent
Stateless components can't be the target of a ref . There's no backing instance. You can't have refs internally to children either. Remember, ......
Read more >How to use Props in React - Robin Wieruch
The child component doesn't care whether the value inside the props are stateful values -- it just sees them as props which come...
Read more >[Solved]-React stateless component not working-Reactjs
forcedBackUrl} /> return ( <div> <Back {...this.props.back} /> {this.props.children} </div> );. Sean Vieira 149154. score:0. import React, { Component } ...
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
@iam4x Sorry… didn’t raise an issue like a decent human, heh. Just went straight to Gitter.
I’ll raise one now for public visibility.
@developit Where’s the issue from @devgeeks? It might the same thing I get…