Skip to content

Instantly share code, notes, and snippets.

@IamGiel
Created February 22, 2018 03:31
Show Gist options
  • Save IamGiel/ecb0a976400344af70f4f78cd0ba4d09 to your computer and use it in GitHub Desktop.
Save IamGiel/ecb0a976400344af70f4f78cd0ba4d09 to your computer and use it in GitHub Desktop.
Not sure how I can make `rainDrops` loop inside the NavBar function
import React from "react";
import "../styles/NavBar.css";
const drops = 500;
const rain = ('<div class="drop" id="drop' + i + '"></div>')
for (let i = 0; i < drops.length; i++) {
let rainDrops = drops[i];
}
const NavBar = () => (
<div>
<section className="rain" className="rain"
left={Math.floor(Math.random() * (16000 - 0 + 1)) + 1}
top={Math.floor(Math.random() * (-1000 - 1400 + 1)) + 1}>
{rainDrops}
</section>
</div>
);
export default NavBar;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment