Parameter 'props' implicitly has an 'any' type
Answered
Sun bear posted this in #help-forum
Sun bearOP
Hello, I am getting this error in my code and I would like to know how I can solve it. This is my code:
import { getDictionary } from '@/app/translation/dictionary';
import SignUp from '@/components/SignUpProcess/page';
const Page = async (props) => {
const data = await getDictionary(props.params.lang); // Changed to props.params.lang
return (
<>
<SignUp dictionary={data} />
</>
);
}
export default Page;Answered by Cape horse mackerel
well, then it is
type Props = {
params: {
lang: "en" | "ro";
}
}4 Replies
Cape horse mackerel
well you have to define a type for the props
type Props = {
params: {
lang: string;
}
}
const Page = async (props: Props) => ()@Cape horse mackerel well you have to define a type for the props
ts
type Props = {
params: {
lang: string;
}
}
const Page = async (props: Props) => ()
Sun bearOP
Do I need to define that in the same page ?
Cause if yes, I get another error when doing so
Cape horse mackerel
well, then it is
type Props = {
params: {
lang: "en" | "ro";
}
}Answer