import * as React from "react"; import styled from "../.."; const H1 = styled.h1` color: palevioletred; font-size: 1em; `; function getRandomInt(min: number, max: number) { min = Math.ceil(min); max = Math.floor(max); return Math.floor(Math.random() * (max - min)) + min; } class Random extends React.Component { render() { const i = getRandomInt(1, 6); switch (i) { case 1: return

Hello World

; case 2: return

Hello World

; case 3: return

Hello World

; case 4: return

Hello World

; case 5: return
Hello World
; case 6: return
Hello World
; default: return null; } } } const H2 = H1.withComponent("h2"); const a = H1.withComponent("a"); const abbr = H1.withComponent("abbr"); const RandomHeading = H1.withComponent(Random);