gl-react sample not working on react-native app

  javascript, react-native, reactjs

Trying to display the sampe provided in https://gl-react-cookbook.surge.sh/helloblue?blue=0.96&menu=true but no success
any idea what is going on here?
Tks for your help 😉
this my sample

import React from 'react';
import { StyleSheet } from 'react-native';
import { Surface } from 'gl-react-native';
import { Shaders, Node, GLSL } from 'gl-react';

const styles = StyleSheet.create({
  surface: {
    borderWidth: 1, ==> this for testing only 
    height: 300,
    width: 200,
  },
});

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

const TestGl = (): JSX.Element => {
  return (
    <Surface style={styles.surface}>
      <Node
        uniforms={{ blue: 0.5 }}
        shader={shaders.helloGL}
        onDraw={() => {
          console.log('Node created'); --> never triggerd 
        }}
      />
    </Surface>
  );
};

// eslint-disable-next-line react/display-name
export default TestGl;

package.json

"gl-react": "5.0.0",
"gl-react-native": "5.0.0",
"react": "16.11.0",
"react-native": "0.62.2",

enter image description here

Source: Ask Javascript Questions

LEAVE A COMMENT