Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

trouble rendering pure/stateless components #49

Closed
travi opened this issue Apr 5, 2016 · 5 comments
Closed

trouble rendering pure/stateless components #49

travi opened this issue Apr 5, 2016 · 5 comments

Comments

@travi
Copy link

travi commented Apr 5, 2016

As briefly mentioned in #16, I'm having trouble getting a pure component to render in a simple reference application. I receive the error Error: inst.render is not a function when attempting to render this component.

I plan to keep digging deeper to try to confirm my suspicions, but thought you may be able to confirm more quickly or guide me in another direction.

@arunoda
Copy link
Member

arunoda commented Apr 5, 2016

Seems everything okay for me at a quick glance. Give it a try to find the problem. If not, ping me.
I'll try to debug.

@travi
Copy link
Author

travi commented Apr 5, 2016

I did sort it out. I forgot that this component was wrapped in a factory function. Once I sorted that out, it worked correctly.

Sorry for the noise.

@travi travi closed this as completed Apr 5, 2016
@arunoda
Copy link
Member

arunoda commented Apr 5, 2016

Okay. Great.

@nobleach
Copy link

nobleach commented Apr 6, 2016

I'm actually having the same problem. Any component created by class MyComponent extends React.Component works just fine. But if they include any pure components, I get

No `render` method found on the returned component instance: you may have forgotten to define `render`, returned null/false from a stateless component, or tried to render an element whose type is a function that isn't a React component.

I have found that using an explicit return helped. If using parens in a lambda-style pure component, the return is not needed.

@IthacaDream
Copy link

I am experiencing this one too. any solutions?

ndelangen pushed a commit that referenced this issue Apr 5, 2017
Fix wrong detection of propType when isRequired is set
ndelangen pushed a commit that referenced this issue Apr 11, 2017
Check whether app exists before fetching data
thani-sh pushed a commit that referenced this issue May 24, 2017
ndelangen pushed a commit that referenced this issue Feb 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants