()
| 43 | gl: WebGLRenderingContext | null = null; |
| 44 | |
| 45 | componentDidMount() { |
| 46 | invariant( |
| 47 | this.canvas, |
| 48 | "GLView: canvas is not available in componentDidMount!" |
| 49 | ); |
| 50 | const { |
| 51 | webglContextAttributes, |
| 52 | onContextCreate, |
| 53 | onContextFailure, |
| 54 | } = this.props; |
| 55 | const gl = getContext(this.canvas!, webglContextAttributes); |
| 56 | this.webglContextAttributes = webglContextAttributes || {}; |
| 57 | if (gl) { |
| 58 | this.gl = gl; |
| 59 | onContextCreate(gl); |
| 60 | } else { |
| 61 | onContextFailure(new Error("no-webgl-context")); |
| 62 | } |
| 63 | } |
| 64 | |
| 65 | componentDidUpdate(prevProps: any) { |
| 66 | const { width, height } = this.props; |
nothing calls this directly
no test coverage detected