Coder Social home page Coder Social logo

Comments (10)

christopherthielen avatar christopherthielen commented on April 27, 2024 1

This was the key:

function renderReactUIView() {
// console.log(`${$id}: rendering react uiview into container`, el);
if (destroyed) {
// console.error(`${$id}: react-ui-view-adapter has already been destroyed -- not rendering React UIView`);
return;
}
const props = { ...attrs, render, wrap: false, refFn: ref };
// console.log(`${$id}: rendering ReactUIView with props`, props);
ReactDOM.render<any>(<ReactUIView {...props}/>, el as any);
}

It was re-rendering the react UIView after the angular adapter had been destroyed.

from react-hybrid.

hrgui avatar hrgui commented on April 27, 2024

That's interesting - because we have React 16 running fine with react-hybrid?

Although there are some unmounting errors, will provide when I come across them again.

from react-hybrid.

christopherthielen avatar christopherthielen commented on April 27, 2024

I'd like to see those errors.

Here's a stackblitz set up with @uirouter/react-hybrid which shows at least one of the issues I've run across: https://stackblitz.com/edit/ui-router-react-hybrid-respce?file=index.js

from react-hybrid.

christopherthielen avatar christopherthielen commented on April 27, 2024

I've also added the trivial example to this repo and wired it as an e2e test (yarn test:downstream -- requires yalc installed globally)

from react-hybrid.

christopherthielen avatar christopherthielen commented on April 27, 2024

Loading #!/angular

screen shot 2018-03-10 at 10 47 52 am

from react-hybrid.

christopherthielen avatar christopherthielen commented on April 27, 2024

going from #!/angular/react to #!/angular

screen shot 2018-03-10 at 10 49 15 am

from react-hybrid.

hrgui avatar hrgui commented on April 27, 2024

#12 (comment) is the error that I encountered

I'm wondering if React is asking @ui-router/react-hybrid to do https://reactjs.org/docs/react-dom.html#unmountcomponentatnode on exit?

from react-hybrid.

hrgui avatar hrgui commented on April 27, 2024

Interesting - the ref callback fires again when unMountComponentAtNode is called.

from react-hybrid.

christopherthielen avatar christopherthielen commented on April 27, 2024

Interesting - the ref callback fires again when unMountComponentAtNode is called.

is that a problem though? It gets called with null right?

from react-hybrid.

hrgui avatar hrgui commented on April 27, 2024

#12 (comment)

Nope, it's not a problem, and yes it gets called with null:
https://github.com/facebook/react/blob/94518b068bf52196abea0c83f4c9926bfe2065c6/packages/react-reconciler/src/ReactFiberCommitWork.js#L136

Seems to be part of React Fiber.

from react-hybrid.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.