Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/reactjs/25.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript gl react示例不在react本机应用程序上工作_Javascript_Reactjs_React Native - Fatal编程技术网

Javascript gl react示例不在react本机应用程序上工作

Javascript gl react示例不在react本机应用程序上工作,javascript,reactjs,react-native,Javascript,Reactjs,React Native,尝试显示中提供的sampe,但未成功 知道这是怎么回事吗? 谢谢你的帮助;) 这是我的样品 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({ surfa

尝试显示中提供的sampe,但未成功 知道这是怎么回事吗? 谢谢你的帮助;) 这是我的样品

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;

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