I'm playing around with styled-components and trying to create a svg circle spinner component. Everything is great except when I try to use the component multiple times in same page then every component is using the same strokeColor from the last one. The other props strokeWidth is working fine though.
import React from "react";
import ReactDOM from "react-dom";
import Spinner from "./Spinner";
import "./styles.css";
function App() {
return (
<div className="App">
<Spinner strokeColor="#000000" strokeWidth={2} />
<Spinner strokeColor="red" strokeWidth={1} />
</div>
);
}
const rootElement = document.getElementById("root");
ReactDOM.render(<App />, rootElement);
What am I missing here?
Here's the codesandbox demo link: https://codesandbox.io/s/pyo8kox787