gl-react/packages/tests/flow/incorrect.js
Gaëtan Renaudeau 3e11611445 fix tests
2017-07-18 12:01:32 +02:00

81 lines
1.3 KiB
JavaScript
Executable File

//@flow
import React from "react";
import {
Shaders,
Node,
LinearCopy,
NearestCopy,
GLSL,
Visitor,
TextureLoader,
TextureLoaders,
Backbuffer,
Bus,
VisitorLogger,
connectSize
} from "gl-react";
import { Surface } from "gl-react-headless";
<Node />;
<Surface />;
<LinearCopy />;
<NearestCopy />;
<Bus />;
<Node nope />;
<Surface nope />;
<Bus nope />;
const shaders = Shaders.create({
valid: {
frag: GLSL`...`
},
a: null,
b: {},
c: { frag: true }
});
class A extends React.Component {
surface: ?Surface;
node: ?Node;
doThings() {
const { surface, node } = this;
if (surface && node) {
surface.nope();
node.nope();
}
}
render() {
return (
<Surface ref={ref => (this.surface = ref)} notexists>
<Bus ref="o" notexists>
<Node />
</Bus>
<LinearCopy>
<Node shaders={shaders.valid} notexists />
</LinearCopy>
</Surface>
);
}
}
connectSize();
const N = connectSize(() =>
// these are all wrong props
<Node
sync={1}
clear={42}
width={false}
height={false}
blendFunc={{
src: "nope",
interpolation: "interpolation_nope",
wrap: "wrap_nope"
}}
preload={false}
visitor={false}
shader={false}
/>
);