GithubHelp home page GithubHelp logo

React 18 support about react-canvas-confetti HOT 4 CLOSED

ulitcos avatar ulitcos commented on June 15, 2024
React 18 support

from react-canvas-confetti.

Comments (4)

ulitcos avatar ulitcos commented on June 15, 2024

Yes, I think everything should work perfectly. I checked the examples on version 18 below by following the links. Did you run into any problems?

https://codesandbox.io/s/fireworks-cl-react-canvas-confetti-forked-tkj37h

https://codesandbox.io/s/school-pride-fn-react-canvas-confetti-forked-v89wrb

from react-canvas-confetti.

hichemfantar avatar hichemfantar commented on June 15, 2024

This warning comes up in the console log.
Warning: ReactDOM.render is no longer supported in React 18. Use createRoot instead. Until you switch to the new API, your app will behave as if it's running React 17. Learn more: https://reactjs.org/link/switch-to-createroot

from react-canvas-confetti.

ulitcos avatar ulitcos commented on June 15, 2024

This is not a library issue. If you are going to use react 18 you need to use the new createRoot API. Just replace your code

const rootElement = document.getElementById("root");
ReactDOM.render(<App />,  rootElement);

with that

const container = document.getElementById("root");
const root = createRoot(container);
root.render(<App />);

from react-canvas-confetti.

hichemfantar avatar hichemfantar commented on June 15, 2024

I thought it was the library using the old api. Thanks!

from react-canvas-confetti.

Related Issues (11)

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.