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

Accessing isMounted inside its render() #38

Closed
kibs opened this issue Mar 23, 2015 · 2 comments
Closed

Accessing isMounted inside its render() #38

kibs opened this issue Mar 23, 2015 · 2 comments

Comments

@kibs
Copy link

kibs commented Mar 23, 2015

The console gives me a warning that "ReactGridLayout is accessing isMounted inside its render()"
I know this doesn't affect the grid, but maybe in a later React version, this will become a real issue.

Only tested using React 0.13

@STRML
Copy link
Collaborator

STRML commented Mar 23, 2015

Yeah, it appears they may be removing isMounted() - best I can tell is
that they say it won't work inside ES6 classes, but I haven't gotten any
coherent reason as to why, or why it would be removed.

We use it to switch to CSS transforms after mounting which have better
performance, but it is not possible to do this effectively on the
server-side. This is because CSS transforms don't support percentage
offsets - while top and left percentage values are equal to their
container ("move this element down 40% of its container's height"),
percentages with CSS transforms are relative to themselves ("move this
element down 40% of its own height"), which is not useful.

Since we don't know the browser's width on the server this leads to
breakage on initial load until the JS has time to run. I didn't want to
turn this into yet another app that shows a "loading..." screen, I want
the layout to be correct when starting, so that's why we use this. It's
not enough to simply check process.browser, because otherwise the
layout will fail the checksum.

On 3/23/15 8:42 AM, Sune Kibsgaard Pedersen wrote:

The console gives me a warning that "ReactGridLayout is accessing
isMounted inside its render()"
I know this doesn't affect the grid, but maybe in a later React
version, this will become a real issue.

Only tested using React 0.13


Reply to this email directly or view it on GitHub
#38.

@kibs
Copy link
Author

kibs commented Mar 23, 2015

Ahh makes sense, didn't really think about serverside. Didn't really think you didn't know, as you probably also are using the console 😉 but couldn't find an issue, so I thought I would ask.

Thank you for the detailed answer, and thank you for this really great project!

@STRML STRML closed this as completed in 9045084 Apr 2, 2015
TeaBough pushed a commit to TeaBough/react-grid-layout that referenced this issue Apr 4, 2015
TeaBough pushed a commit to TeaBough/react-grid-layout that referenced this issue Apr 5, 2015
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

2 participants