Skip to content

Error: Surface uses the legacy childContextTypes API #444

Open
@TheLogan

Description

@TheLogan

Just added this to my react project, but I am getting this error:
Surface uses the legacy childContextTypes API which was removed in React 19. Use React.createContext()

This is my code, essentially it's just the example code

import { Shaders, Node, GLSL } from "gl-react";
import { Surface } from "gl-react-dom";

const shaders = Shaders.create({
  helloBlue: {
    frag: GLSL`
    precision highp float;
    varying vec2 uv;
    uniform float blue;
    void main() {
      gl_FragColor = vec4(uv.x, uv.y, blue, 1.0);
    }`
  }
});


const GlVfx = () => {
  return (
    <Surface width={300} height={300}>
      {/* 
      // @ts-expect-error uniforms requires string index not number */}
      <Node shader={shaders.helloBlue} uniforms={0.5} />
    </Surface>
  );
};

export default GlVfx;

"react": "^19.0.0",
"react-dom": "^19.0.0",

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions