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

[RFC] Queue callbacks between render and componentDidUpdate functions. #6816

Closed
wants to merge 1 commit into from

Conversation

pvolok
Copy link

@pvolok pvolok commented May 20, 2016

I'm experimenting with aphrodite in my current project. Aphrodite works well but has one flaw comparing to inline styles and css. It uses asap to inject styles in the next tick after render functions.

Like this:
Component.render()
Component.componentDidMount/componentDidUpdate()
injectCss()
browser's render

The problem with this is than we can't measure dom in componentDidUpdate as css-styles are not applied yet (unless they were injected after past renders). It would be cool if there was a way to still buffer styles in all render functions but flush them before componentDidUpdate.

This PR is just a guess how it might look like (I haven't dug into react src much). Not intended to be merged :)

@sophiebits
Copy link
Collaborator

I understand the problem in aphrodite but don't understand how this helps. Each component's componentDidMount/componentDidUpdate is called before the parent's componentDidMount/componentDidUpdate. ReactUpdates.asap is something completely unrelated to the asap project. There is no way to insert a callback after every HTML update before the component callbacks run.

@sophiebits sophiebits closed this May 31, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants