Closed
Description
I am using holder.js in React with react-bootstrap. In index.html
I added in <header>
:
<script src="holder.js"></script>
In the component ProjectCard
I wrote:
<Card.Img className="proj-card-img" variant="top" data-src="holder.js/100px180" />
This component is rendered using map() function
{Object.keys(this.state.projects).map(key=>
<ProjectCard key={key} index={key} details={this.state.projects[key]}/>)}
It works nicely if I set state in ComponentWillMount()
. However, if I update the state and the page renders twice (e.g. use firebase to syncState), holder.js will not work.
I have tried
<script>
Holder.run({
images:"MyClassName"
})
</script>
but it didn't work either.
Did I write anything wrong? Thanks!
Metadata
Metadata
Assignees
Labels
No labels