Skip to content

Instantly share code, notes, and snippets.

@JWLangford
Created October 18, 2022 17:40
Show Gist options
  • Save JWLangford/08968d3b7e3b2c591f921de9b055f35c to your computer and use it in GitHub Desktop.
Save JWLangford/08968d3b7e3b2c591f921de9b055f35c to your computer and use it in GitHub Desktop.
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