Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Problems with div tag & type any in styles-components (Gatsby app)

i'm not sure what to do with this error. the thing still compiled successfully but my content inside the div still wont show up in the browser:

([ts] Property 'div' does not exist on type '(tag: any) => { (...args: any[]): any; withConfig(config: any): ...; attrs(attrs: any): ...; }'. [2339])

What am I doing wrong here?

 let iconNames = []
for (let index = 0; index < icons.length; index++) {
    iconNames.push(icons[index]["name"])
}
//align-items, for verticle
//justify-items, for horizontal
const Container = styled.div ` // <== error        is on this line here 
     height: 100%;
     display: grid;
     align-items: center; 
     justify-items: center; 
    `
// Define type of property
interface Props {
    name: string;
}
interface State {
    svg: any;
}
like image 918
geekmonster Avatar asked Oct 17 '22 07:10

geekmonster


1 Answers

This problem went away for me by installing @types/styled-components

like image 102
aoh Avatar answered Oct 27 '22 09:10

aoh