Do i need to always use function declaration in next js routes?
Answered
Raspberry Horntail posted this in #help-forum
Raspberry HorntailOP
if i write routes in function expression example
If i write like this i have warning in terminal
}
const FirstBlog = ({params}:{params:{slug:string[]}}) =>{
return <div></div>
}If i write like this i have warning in terminal
Answered by joulev
oh i see, this is new. in that case you can use
but yeah, just use the
const FirstBlog = ({params}:{params:{slug:string[]}}) =>{
return <div></div>
}
FirstBlog.displayName = "FirstBlog"but yeah, just use the
function syntax4 Replies
@joulev what warning is it? that syntax should be fine
Raspberry HorntailOP
Your React component is an anonymous function.@Raspberry Horntail Your React component is an anonymous function.
oh i see, this is new. in that case you can use
but yeah, just use the
const FirstBlog = ({params}:{params:{slug:string[]}}) =>{
return <div></div>
}
FirstBlog.displayName = "FirstBlog"but yeah, just use the
function syntaxAnswer