composants stylisés NPM
npm i styled-components
Shiny Squirrel
npm i styled-components
npm install --save styled-components
# yarn
yarn add styled-components
npm install styled-components
npm install --save-dev @types/styled-components
// yarn
yarn add styled-components
yarn add --save-dev @types/styled-components
import styled from 'styled-components'
const RedText = styled.p`
color: red;
`
class App extends Component {}
import React from "react";
import styled from "styled-components";
export default function Wrapper({ children }) {
return (
<div>
<StyledButton>{children}</StyledButton>
</div>
);
}
const StyledButton = styled("div")`
padding: 10px;
margin: 10px;
`;
# with npm
npm install --save styled-components
# with yarn
yarn add styled-components