add hover style react code example
Example 1: react css hover animation
npm install style-it
*********
import React from "react";
import Style from "style-it";
class UrClass extends React.Component {
render() {
return Style.it(
`
.myDiv:hover {
color:red;
transform: scale(1.001);
background: #f0c14b;
}
`,
<div className="myDiv">sample text</div>
);
}
}
export default UrClass;
Example 2: jsx .style on hover react
import styles from './Button.css'
const MyButton = ({children, onClick, type='primary', ...rest }) =>
(
<button
onClick = {onClick}
className = {styles.primary}
{...rest}
>
{children}
</button>
);