Closed thespacecadette closed 8 years ago
(bump)
var Masonry = require('react-masonry-component')(React);
Are you sure you have the (React)
part on the end?
It should probably have been changed to use peerDependencies
instead, so that you don't have to inject React as a dependency
This worked
import Masonry from 'masonry';
const masonry = Masonry(React);
@thespacecadette This should now work differently in 3.0.0
You can give the 3.0.0 beta a spin if you like.
npm install react-masonry-component@3.0.0-rc.1
This version no longer requires passing in React as an argument, you can require the component and use it straight away. More info in the Readme
Tried in 3.0.0-rc.1, got this error:
Error: Cannot resolve module 'eventEmitter/EventEmitter' in C:\...\react-masonry-component\node_modules\imagesLoaded
Then a number of similar ones for outlayer
, 'get-size', and 'fizzy-ui-utils'. I'm combining Meteor and React, so maybe there's something weird going on based on the Meteor build process? Going to try and do what @thespacecadette said instead.
@john-osullivan that shouldn't work with 3.0.0 because the API has changed.
Your issue is because 'eventEmitter/EventEmitter' (and all the others) are AMD dependencies. Are you using Webpack by any chance? If so you need to add the loader as per the readme.
If not using webpack, are you using AMD?
It seems this might be a Meteor specific thing, I think it warrants it's own issue. I will close this one and open another as this issue is for a different matter.
Hi guys,
Having an issue with Masonry Component's parameter "disableImagesLoaded". It throws this error:
I've tried parsing false and creating a variable with false, but doesn't seem to work.
Is anyone else having issues with this?