score:5

Accepted answer
import * as React from "react";
import Box from "./Box";
import Text from "./Text";
import Text2 from "./Text2";
import Text3 from "./Text3";
import "./styles.css";

const App = (): React.ReactElement => (
  <div className="app">
    <h1>Example 1 - "styles" as CSS Styles</h1>
    <Box>
      <Text styles={{ height: "10px" }}>Hello</Text>
      <Text as="h1">Goodbye</Text>
    </Box>
    <hr />
    <h1>Example 2 - "style" as DOM styles</h1>
    <Box>
      <Text2 style={{ height: "10px" }}>Hello</Text2>
      <Text2 as="h1">Goodbye</Text2>
    </Box>
    <hr />
    <h1>Example 3 - "styles" as DOM styles</h1>
    <Box>
      <Text3 styles={{ height: "10px" }}>Hello</Text3>
      <Text3 as="h1">Goodbye</Text3>
    </Box>
  </div>
);

export default App;

score:0

<script crossorigin src="https://unpkg.com/react@17/umd/react.production.min.js"></script>
<script crossorigin src="https://unpkg.com/react-dom@17/umd/react-dom.production.min.js"></script></script>
<script src="https://unpkg.com/react-is@17/umd/react-is.production.min.js"></script>
<script src="https://unpkg.com/styled-components/dist/styled-components.min.js"></script>

<div id="root"></div>

Related Query

More Query from same tag