mithi / epic-react-exercises

Practical React exercises with detailed solutions.
https://epic-react-exercises.vercel.app
Apache License 2.0
159 stars 36 forks source link

Refactor `DynamicMarkdown` #66

Closed mithi closed 3 years ago

mithi commented 3 years ago

I've been copy pasting this everywhere. Put this somewhere to be reusable

import dynamic from "next/dynamic"
import { SpinnerDots } from "components/spinner"

const DynamicMarkdownRender = dynamic(() => import("components/markdown-render"), {
    // eslint-disable-next-line react/display-name
    loading: () => <SpinnerDots />,
})

They're found in the following: