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

Logic within render for the container in redux-async example #1724

Closed
vamsiampolu opened this issue May 13, 2016 · 1 comment
Closed

Logic within render for the container in redux-async example #1724

vamsiampolu opened this issue May 13, 2016 · 1 comment

Comments

@vamsiampolu
Copy link

I notice that the render method in the async example has a lot of complex logic, I split the logic out into multiple smaller components within the render method. Is this an anti-pattern?

The code is in the gist here

@gaearon
Copy link
Contributor

gaearon commented May 13, 2016

Defining them inside render() is definitely an anti-pattern. React will not be able to diff those effectively because they have a new type on every render.

However, defining them outside render() is great and is better than fat render() methods. The examples in Redux repo are far from perfect examples of React best practices, and there is much to improve there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants