expo / expo-2d-context

A pure-js implementation of the W3C's Canvas-2D Context API that can be run on either Expo Graphics or WebGL
109 stars 7 forks source link

onContextCreate not called when debugger is open. #8

Closed ghost closed 5 years ago

ghost commented 5 years ago

Tested with the external React Native Debugger as well as default one that opens in Chrome.

onTouchStart triggers the alert "touch start" always, so I know that GLView exists in React's tree. However _onGLContextCreate does not seem to be called (only when using debugger) as the alert "created context" does not appear in debug mode.

Here is a class that demonstrates the bug:

class TestDummy extends React.Component {
  constructor(props) {
    super(props);
    this._onGLContextCreate = this._onGLContextCreate.bind(this);
  }

  render() {
    return <GLView
              style={{ flex: 1 }}
              onContextCreate={this._onGLContextCreate}
              onTouchStart={(e) => alert('touch start')}
           />;
  }

  _onGLContextCreate(gl) {
    alert('created context');
  }
}
naclomi commented 5 years ago

Thanks for reporting this issue, Evan. Because it is a bug in Expo's underlying GLView component, could you please re-report it over at the Expo client repository (https://github.com/expo/expo) ?