Skip to content

How to use gl-react with next.js ? Is there any documentation about this ? #432

Open
@amapic

Description

@amapic

hello,

I am using gl-react-headless with next.js. Nothing is rendered and I have this error:

Received false for a non-boolean attribute debug.

If you want to write it to the DOM, pass a string instead: debug="false" or debug={value.toString()}.

What to do ?

here's my code:

import React, { dyna } from "react";
import { Shaders, Node, GLSL } from "gl-react";
import { Surface } from "gl-react-headless"; // for React DOM
import dynamic from "next/dynamic";
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);
}`,
  },
});
class HelloBlue extends React.Component {
  render() {
    const { blue } = this.props;
    return <Node shader={shaders.helloBlue} uniforms={{ blue }} />;
  }
}

export default function Home() {
  return (
    <Surface width={300} height={300}>
      <HelloBlue blue={0.5} />
    </Surface>
  );
}

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