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.

props.children unavailable in stateless function

See original GitHub issue

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

github_iconTop GitHub Comments

2reactions
devgeekscommented, Sep 30, 2016

@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.

0reactions
iam4xcommented, Sep 30, 2016

@developit Where’s the issue from @devgeeks? It might the same thing I get…

Read more comments on GitHub >

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

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