An Interest In:
Web News this Week
- April 27, 2024
- April 26, 2024
- April 25, 2024
- April 24, 2024
- April 23, 2024
- April 22, 2024
- April 21, 2024
April 9, 2022 04:19 am GMT
Original Link: https://dev.to/agiksetiawan/how-to-create-style-with-typed-save-in-react-js-26a
How to create Style with typed safe in React JS
That ways very simple using 'CSSProperties'
import { CSSProperties } from "react";
create style
const BannerStyle : CSSProperties = { background: `url(/img/product/shop-bg.jpg)`, backgroundRepeat:'no-repeat', backgroundPosition:'center center', backgroundSize:'cover', position:'relative' }
and then use style into html tag
<div style={BannerStyle}></div>
Original Link: https://dev.to/agiksetiawan/how-to-create-style-with-typed-save-in-react-js-26a
Share this article:
Tweet
View Full Article
Dev To
An online community for sharing and discovering great ideas, having debates, and making friendsMore About this Source Visit Dev To