Flipboard / react-canvas

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

I'm having issues with importing the module. #148

Closed davesnx closed 7 years ago

davesnx commented 8 years ago

Hi,

I found an interesting issue, and could be more for my curiosity, but I'm using ES6 with babel.

So I could import the module like that:

import { Surface, Group, Image, Text, FontFace } from 'react-canvas'

and use all of the Components that react-canvas provide. But, I didn't get any error It's just doesn't render. But... If I'm importing first the default and then I get the objects, everything works fine. (isn't the spread operator, btw).

import ReactCanvas from 'react-canvas'
const { Surface, Group, Image, Text, FontFace } = ReactCanvas

I didn't check how the export works here, but seems that something weird is happening on the module.export.

davesnx commented 8 years ago

Nothing @tuxracer or @darkyen or @codrin-iftimie?

codrin-iftimie commented 8 years ago

Works on my end. You can clone the repo in order to see for yourself.

Maybe there is a problem with babel. Can you give me more info about your webpack config file?

davesnx commented 8 years ago

Let me try this weekend and I will tell! Thanks for respond @codrin-iftimie