J
J
js_web2018-10-09 14:32:59
React
js_web, 2018-10-09 14:32:59

How to create a portal?

renderTooltip = node => {
    console.log("renderTooltip", node); //{$$typeof: Symbol(react.element), type: "span", key: null, ref: null, props: {…}, …}
    ReactDOM.createPortal(node, document.querySelector("#root"));
  };

For some reason, nothing appears in the root container
Tell me please.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Mikhail Osher, 2018-10-09
@js_web

return forgot before ReactDOM.createPortal

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question