Code Monkey home page Code Monkey logo

Comments (6)

percyhanna avatar percyhanna commented on June 16, 2024

I've never seen findDOMNode return null unless there's an error in your rendering. The render function must ALWAYS return an element, so every component must had a DOM node.

My suspicion is that your DOM tree is being modified by the browser, which would normally cause an invariant violation as well. See here: http://stackoverflow.com/questions/25026399/uncaught-error-invariant-violation-findcomponentroot-110-unable-to

In any case, I need an easily reproducible example in order to be able to fix anything. findDOMNode always returns a value for valid React trees.

from rquery.

percyhanna avatar percyhanna commented on June 16, 2024

Not a bug in rquery, from what I can tell.

from rquery.

karudo avatar karudo commented on June 16, 2024

Why the render function must ALWAYS return an element?
The documentation says that the render function may return null

You can also return null or false to indicate that you don't want anything rendered. Behind the scenes, React renders a <noscript> tag to work with our current diffing algorithm. When returning null or false, ReactDOM.findDOMNode(this) will return null.

from rquery.

percyhanna avatar percyhanna commented on June 16, 2024

Hmm, I had missed that change in the React spec. In previous versions render was definitely required to return something.

from rquery.

percyhanna avatar percyhanna commented on June 16, 2024

Fix released as version 4.3.0. Hopefully that works for you. Thanks for the bug report!

from rquery.

karudo avatar karudo commented on June 16, 2024

Yes, its works for me. Thank you!

from rquery.

Related Issues (12)

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.