0
I wanted to at least print the background red I put on footer.module.scss on index.tsx. I’m using this structure:
and is returning this bug here, at index.tsx:
Property 'lance' is missing in type '{}' but required in type 'IProps'.
The index.tsx:
import Footer from "./../components/footer"
import { IProps } from "./../components/footer/types"
function Batata() {
return (
<>
{/* Configurações de head (helmet) */}
<main>{<Footer></Footer>}</main>
</>
)
}
export default Batata
My Footer.tsx:
import React from "react"
import { IProps } from "./types"
import scss from "./Footer.module.scss"
function Footer(props: IProps) {
return <section className={scss.container}>{props.lance}</section>
}
export default Footer
The package.json
{"main":"Footer.tsx"}
The types.ts:
export interface IProps {
lance: string
}
The right thing wouldn’t be
<main><Footer lance='algo'></Footer></main>
? You are calling the component without passing the props to it...– Rafael Tavares
Thank you, that’s what I needed.
– harriet