Giter VIP home page Giter VIP logo

Comments (4)

Morantron avatar Morantron commented on May 24, 2024 2

I think this is related to React 18 Strict Mode.

If you create a fresh project with create-react-app and add gl-react and gl-react-dom you can reproduce the issue.

If you comment the out strict mode in src/index.js the error goes away:

 const root = ReactDOM.createRoot(document.getElementById('root'));                                                                                                                 
  root.render(                                                                                                                                                                       
-    <React.StrictMode>                                                                                                                                                               
      <App />                                                                                                                                                                        
-    </React.StrictMode>                                                                                                                                                              
  );

from gl-react.

gre avatar gre commented on May 24, 2024 1

Mmh curiously the cookbook uses React 18. I will have to recreate a basic example to try to reproduce.
But I'm using React + GL React ~ every week, making art projects of my own with it and never experienced this 👀

from gl-react.

guidovizoso avatar guidovizoso commented on May 24, 2024

A little more context: It happens on React 18 only. Just tested it with a fresh project with React 17 and it's working.

It is also failing on everything shader related thing that I tried. Even making a shader program from scratch throws the same error so it's probably not related to the library per se but if @gre or someone with more WebGL experience can check it out it'd be better.

from gl-react.

guidovizoso avatar guidovizoso commented on May 24, 2024

Was able to pinpoint this issue to this file in gl-shader: https://github.com/stackgl/gl-shader/blob/master/lib/shader-cache.js (line 55). Guess it's out of the scope of the library though

from gl-react.

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.