Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

react styled functional component

import React from "react";
import styled from "styled-components";

const index = styled(({ className }) => {
  return (
    <div className={className}>
      <h1>Hello there!</h1>
    </div>
  );
})`
  padding: 0 2rem;

  h1 {
	color: red;
  }
`;

export default index;
 
PREVIOUS NEXT
Tagged: #react #styled #functional #component
ADD COMMENT
Topic
Name
3+2 =