Flipboard / react-canvas

High performance <canvas> rendering for React components
BSD 3-Clause "New" or "Revised" License
13.18k stars 919 forks source link

Support for react v15.0 #134

Open singggum3b opened 8 years ago

singggum3b commented 8 years ago

React just release major v15.0 with full svg support. https://facebook.github.io/react/blog/. I suppose this could have large impact on react-canvas?

evenstensberg commented 8 years ago

Hi! Since React-Canvas already uses ReactDOM.render to render components, and they use React.createElement/Document.createElement, this is much unlikely. However, you can see that this library hasn't been updated for a while. It uses regular var requires and dependencies hasn't been updated. I'll put up a updated PR later on today, if that helps this issue. :smile:

evenstensberg commented 8 years ago

The only thing that I can see now that is affected by v15 is var assign = require('react/lib/Object.assign'); as react has changed this

hoanghuu commented 8 years ago

When i try use react-canvas with react v15, it not working. The react throw exception "Uncaught TypeError: Cannot read property 'props' of undefined" on the function mountComponent of Group component.

Any idea for fix this bug?

gre commented 8 years ago

I was starting to work on a fix and it's more fundamental than "just fix the assign". there are bunch of problem and I don't have time for this. react-canvas uses bunch of internal React API that have all changed (mountComponent signature, and bunch of other signatures).

so I recommend you guys to use react-art that is highly maintain and always up to date.

Scarysize commented 8 years ago

Maybe put up a warning at the top of the README...

Gabri3l commented 8 years ago

I am having the following issue when running an app that is importing 'react-canvas':

Uncaught Error: ENOENT: no such file or directory, open '//classes.trie'

I am currently using react v15 and while npm installing I get

react-canvas@1.2.1 requires a peer of react@^0.14.0 but none was installed.

Is this a compatibility issue or is something wrong on my end ? I only installed the package and used a very basic Surface + Image.

gre commented 8 years ago

It's a compatibility issue. The current implementation is far from working with React 15. Current implementation rely on some react 0.14 internal APIs that have changed.

Gabri3l commented 8 years ago

Oh ok got it! Thanks

framerate commented 8 years ago

It's possible for someone like me to maybe downgrade to react 0.14 if I knew 15.x support was coming.

Is there any information on this anywhere?

pinqy520 commented 7 years ago

159