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

15.4 compatibility #18

Closed
wants to merge 3 commits into from
Closed

15.4 compatibility #18

wants to merge 3 commits into from

Conversation

iamdustan
Copy link
Owner

Straight from the diff:

+> [WARNING]: this branch is being developed against my React Stack Reconciler package
+> branch of React.js. This is a hack to expose the minimal required internals in
+> a standalone package. This suffers from the same issues that requiring React
+> internals had before (shared state), though that is likely not to be an issue.
+> If it is custom React renderers are way more popular than I had thought.

@iamdustan
Copy link
Owner Author

This will close #14.

@iammerrick
Copy link

Hey @iamdustan thank you for your awesome work on this. You've really helped me understand React a bunch better than I ever did before. Also thankful you are trying to update as react updates. Thank you! <3

@luski
Copy link

luski commented Apr 17, 2017

Hi @iamdustan! Firstly, congratulations, this is a great repository 👍

Are you tracking changes in React regarding the stack? I am trying to implement my own renderer using the latest React version and code from this repository and I have a bunch of problems, such as:

  1. most of required packages was moved to react-dom, but it's ok, I found where they are exactly.
  2. in the injections module the: ReactInjection.Component.injectEnvironment(ReactComponentBrowserEnvironment); should be added.

And now I have a problem that I can't solve. I probably missed something - maybe you could help me with that? My problem is as follows. In the render function of the root component some node is created if the flag held in state is true and removed if the flag is false. Something like:

const element = this.state.flag ? <node /> : null;
return (
  <tree>
    <leaf />
    {element}
  </tree>
);

So when the state is changed and the flag is set to false I got exceptions. I solved the first exception by calling the
ReactDOMComponentTree.precacheNode(this, this.node)
in the mount function of the component class. It is used in the ReactDomComponent as well. But then I got another exception. I followed the code from the exception stack and it looks like the React tries to perform DOM operations from the DOMLazyTree.js file (the exception is thrown in the insertTreeBefore function). This file is used in the ReactDOMComponent.js (which probably is not used because I injected my own implementation of the component?), DOMChildrenOperations.js and ReactMount.js. I could find where these files are used and so on and probably build pretty complicated graph, but first I thought maybe you have a simple answer for me? I'm just afraid I will have to inject the whole react-dom code counterpart to solve my problem and it doesn't sound optimistic :)

@iamdustan
Copy link
Owner Author

@luski hey there! Fortunately/unfortunately the stack reconciler is going away and I won’t be making any updates to this documentation for it. I did just merge the branch with Fiber documentation which is way better/easier/nicer than Stack.

@iamdustan iamdustan closed this Apr 19, 2017
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

Successfully merging this pull request may close these issues.

3 participants