I have this code where I import a constant named colors that container the colors needed for my project :
import styled from 'styled-component';
import colors from '../utils/style/colors';
const Container = styled.div`
background-colors:${colors.background}
`;
const BlogPage = () => {
return (
<Container>
Main Contaienr
</Container>
);
};
export default BlogPage;
Now I wanna import the colors from a database.
I tried getStaticProps, but I could not use the props outside of the function component.
My question is how can I fetch data and use it outside the function component i.e. : inside a styled-componen