Skip to content

Instantly share code, notes, and snippets.

@antoniomesquita09
Last active March 16, 2021 03:04
Show Gist options
  • Save antoniomesquita09/36da1d9573117ad7e2a6b626be1e3f9e to your computer and use it in GitHub Desktop.
Save antoniomesquita09/36da1d9573117ad7e2a6b626be1e3f9e to your computer and use it in GitHub Desktop.
Basic react-loading-skeleton implementation.
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