alibaba / GCanvas

A lightweight cross-platform graphics rendering engine. (超轻量的跨平台图形引擎) https://alibaba.github.io/GCanvas
Apache License 2.0
1.89k stars 208 forks source link

Cannot read property 'enable' of null, on use of imported declaration XCode #60

Open Kielan opened 6 years ago

Kielan commented 6 years ago

I have tried to follow the instructions and refer to the example, however I have come across an error using the enable method in componentdidmount. I have a reproduceable repo here.

https://github.com/Kielan/canvas-engine-native-qosg

not sure how to fix it, or if it is a babel err, though I believe my current babel setup is correct. Any feedback greatly appreciated :)

Kielan commented 6 years ago

GCanvas is not an npm dependency but must be downloaded separately and added to the project XCode style, also GImage is exported as Image, so you will need to rename export or at least be aware of this if you plan to use this dependency.

Kielan commented 6 years ago

This continues to show up in some build cases/environments, due to linking between gcanavas and react-native-gcanvas pathes in node_modules

flyskywhy commented 3 years ago

@Kielan

Since Alibaba feat: delete weex bridge & reactive bridge, here comes the @flyskywhy/react-native-gcanvas npm package.

After months work, @flyskywhy/react-native-gcanvas runs well on Android and iOS, fix several bugs and add feat: support drawImage() from require('some.png') on Android, iOS and Web described in Changelog.md, refactor with the detailed Example As Usage in README.md.

With Performance Test Result, and Convenient With Browser-like canvas APIs with the easily <canvas/> ported example react-native-particles-bg runs on Android, iOS and Web, @flyskywhy/react-native-gcanvas is the best choice for now :yum: