Skip to content

Instantly share code, notes, and snippets.

@lmduc
Created January 11, 2018 14:49
Show Gist options
  • Save lmduc/254189b79d916782530b5fe267fb3449 to your computer and use it in GitHub Desktop.
Save lmduc/254189b79d916782530b5fe267fb3449 to your computer and use it in GitHub Desktop.
import React, { Component } from 'react'
import config from './particles.json'
class Particlejs extends Component {
componentDidMount() {
let script = document.createElement('script')
script.onload = function() {
particlesJS.load('particlejs', config)
}
script.src = "https://cdn.jsdelivr.net/npm/[email protected]/particles.min.js"
document.head.appendChild(script)
}
render() {
return (
<div id="particlejs"/>
)
}
}
export default Particlejs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment