Skip to content
This repository has been archived by the owner on Sep 21, 2022. It is now read-only.

Ability to mark subtree in render() for pre-rendering #48

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

KevinGrandon
Copy link

Hello! @chrislloyd and myself here from Pinterest. We're currently looking at ways of doing grid layout in React and have a need to pre-render elements to calculate positioning data. We're contemplating using an approach similar to this pull request, and were soliciting feedback on how something like this would look in the core.

I'm worried about performance issues with the current implementation of preRender(), defined inside "02 - Layout Components". The main problem I currently see is that the component itself may have to do additional work to format children before they are measured. As another method you might need to split out your JSX from render(), and have that return an array of formatted objects. Being able to mark a section of the subtree to pre-render, as in this approach, feels cleaner.

Thanks!

@KevinGrandon KevinGrandon changed the title Ability to mark subtree with render() for pre-rendering Ability to mark subtree in render() for pre-rendering Apr 7, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants