Closed EmilioHerreraSoukup closed 7 years ago
Hi @EmilioHerrera
Is this still an issue? Do you have a code example?
Hi @EmilioHerrera
I'm going to close this issue. Please feel free to reopen if needed :-)
I have the same problem,this is my code:
import PropTypes from 'prop-types';
import React from 'react';
import Masonry from 'react-masonry-component';
import styles from './index.less';
const Waterfall = ({ lists }) => {
let masonryOptions = {
transitionDuration: 0,
};
let childElements = lists.map((item) => {
return (
<li key={item.id} className="image-element-class">
<img alt="" src={item.src} />
</li>
);
});
return (
<Masonry
className={'my-gallery-class'} // default ''
elementType={'ul'} // default 'div'
options={masonryOptions} // default {}
disableImagesLoaded={false} // default false
updateOnEachImageLoad={false} // default false and works only if disableImagesLoaded is false
>
{childElements}
</Masonry>
);
};
Waterfall.propTypes = {
};
export default Waterfall;
Hi @chenfengyanyu,
What version of React are you using?
@afram this is what I used in my project:
"react": "^15.4.0",
"react-dom": "^15.4.0",
"react-masonry-component": "^5.0.7",
The same with me, my packages version list as below
"react": "^16.0.0",
"react-dom": "^16.0.0",
"react-masonry-component": "^6.0.0",
Could someone can help me? Thanks a lot.
I get the error:
addComponentAsRefTo(...): Only a ReactOwner can have refs. You might be adding a ref to a component that was not created inside a component's
render
method, or you have multiple copies of React loaded (details: https://fb.me/react-refs-must-have-owner).any help would be appreciated.