默认情况下,微调器不会旋转。但是一个简单的方法可以在创建一个新的React应用程序后触发它像React的logo一样旋转。
添加
类名
在图标上添加一个小css来触发它旋转,如下所示:
import react from 'react';
import './App.css';
import { FaSpinner } from 'react-icons/fa';
function App() {
return (
<div className="App">
<FaSpinner icon="spinner" className="spinner" /> This is a test.
</div>
);
}
export default App;
应用程序.css
.spinner {
animation: spin infinite 5s linear;
/*You can increase or decrease the timer (5s) to
increase or decrease the speed of the spinner*/
}
@keyframes spin {
from {
transform: rotate(0deg);
}
to {
transform: rotate(360deg);
}
}