Currently, I am attempting to create a spinning icon using React, but it seems like I might be overlooking something in my approach. Here is the return function that I have:
return (
<div className="loader">
<p>Loading Data</p>
<FaIcons.FaCog className="loaderIcon"/>
</div>
);
Additionally, this is the CSS code that I have implemented:
.loaderIcon .spin.FaIcons{
margin-right: 7px;
top: 2px;
animation: spin 1s infinite linear;
}
@keyframes spin {
from {
transform: scale(1) rotate(0deg);
}
to {
transform: scale(1) rotate(360deg);
}
}
I am puzzled as to why the icon is not spinning as intended. Can someone offer insight into this issue?