Created
October 18, 2022 17:40
-
-
Save JWLangford/08968d3b7e3b2c591f921de9b055f35c to your computer and use it in GitHub Desktop.
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 styled from "styled-components"; | |
interface ILoading { | |
loading: boolean; | |
} | |
interface IProps extends ILoading { | |
data: any; | |
} | |
const Loader = styled.div<ILoading>` | |
display: ${(props) => (props.loading ? "block" : "none")}; | |
`; | |
export const OuterComponent = (props: IProps) => { | |
const {data, loading} = props | |
return ( | |
<div> | |
<Loader loading={loading} /> | |
{data} | |
</div> | |
) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment