Last active
March 16, 2021 03:04
-
-
Save antoniomesquita09/36da1d9573117ad7e2a6b626be1e3f9e to your computer and use it in GitHub Desktop.
Basic react-loading-skeleton implementation.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { FC } from 'react'; | |
import Skeleton from 'react-loading-skeleton'; | |
type titleProps = { | |
loading: boolean; | |
title: string; | |
}; | |
const Title: FC<titleProps> = ({ loading, title }: titleProps) => { | |
return ( | |
<> | |
{loading ? <Skeleton width={36} height={24} /> : <h1>{title}</h1>} | |
<> | |
); | |
}; | |
export default Title; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment