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

server-side rendering support #44

Open
jamnanlaw opened this issue Feb 17, 2015 · 6 comments
Open

server-side rendering support #44

jamnanlaw opened this issue Feb 17, 2015 · 6 comments

Comments

@jamnanlaw
Copy link

Currently the code has some dependencies on the client-side DOM, e.g.

  1. FixedDataTableColumnResizeHandle componentWillMount has dependency on document.body
  2. getActiveElement (which in turn dependent on document.body) is used

Is there a plan to make this component support isomorphic application?

Thanks.

@pieterv
Copy link
Contributor

pieterv commented Feb 17, 2015

@jamnanlaw I have a fix ready to sync which fixes the two issues you pointed out :) with this change the table renders from the server great, the problem we then have is that react cannot mount onto the rendered HTML since its renders differently based on the environment :(, this is the main culprit: https://github.com/facebook/fixed-data-table/blob/master/src/vendor_upstream/dom/translateDOMPositionXY.js#L23-L45. We will probably need to change the code to always render with top and left on the first pass then use translate if the browser supports after that.

So a long answer but yes we intend to support server rendering :)

pieterv added a commit that referenced this issue Feb 21, 2015
Initial work for server rendering #44
@grahamb
Copy link

grahamb commented Jul 3, 2015

Has there been any update on this? Server rendering is working, but throwing warnings in the browser:

Warning: React attempted to reuse markup in a container but the checksum was invalid. 
This generally means that you are using server rendering and the markup generated on 
the server was not what the client was expecting. React injected new markup to compensate 
which works but you have lost many of the benefits of server rendering. Instead, figure out 
why the markup being generated is different on the client or server:
 (client) ight:50px;z-index:1;transform:translate3
 (server) ight:50px;z-index:1;left:0px;top:0px;" c

@ghost
Copy link

ghost commented Aug 4, 2015

Thank you for reporting this issue and appreciate your patience. We've notified the core team for an update on this issue. We're looking for a response within the next 30 days or the issue may be closed.

@AlesJiranek
Copy link

Is there any update on this? I have same problem as @grahamb

@pieterv
Copy link
Contributor

pieterv commented Aug 17, 2015

Sorry no we haven't made any progress here, this just isn't a use case we have needed. The solution described above is still valid and shouldn't be too hard if someone wants to have a go at solving this.

@wcjordan
Copy link

wcjordan commented Jun 8, 2016

@AlesJiranek @grahamb @jamnanlaw we've merged the PR for this into our fork at https://github.com/schrodinger/fixed-data-table-2 and should have the fix up on npm within a week.

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

No branches or pull requests

6 participants