my code:
<code>function Article(props){
console.log( "[debug] props.content is "+ typeof props.content);
console.log( "[debug] props.content : "+ props.content);
return (
<div>
<h1>{props.title}</h1>
<ReactMarkdown children={props.content} />
</div>
);
async function BlogPost(){
const article = await get_article_by_user_id('02');
return (
<div>
<Nav />
<AuthorInfo />
<Tags />
<Article title={article[0].title} content={article[0].content} />
</div>
);
}
}
</code>
<code>function Article(props){
console.log( "[debug] props.content is "+ typeof props.content);
console.log( "[debug] props.content : "+ props.content);
return (
<div>
<h1>{props.title}</h1>
<ReactMarkdown children={props.content} />
</div>
);
async function BlogPost(){
const article = await get_article_by_user_id('02');
return (
<div>
<Nav />
<AuthorInfo />
<Tags />
<Article title={article[0].title} content={article[0].content} />
</div>
);
}
}
</code>
function Article(props){
console.log( "[debug] props.content is "+ typeof props.content);
console.log( "[debug] props.content : "+ props.content);
return (
<div>
<h1>{props.title}</h1>
<ReactMarkdown children={props.content} />
</div>
);
async function BlogPost(){
const article = await get_article_by_user_id('02');
return (
<div>
<Nav />
<AuthorInfo />
<Tags />
<Article title={article[0].title} content={article[0].content} />
</div>
);
}
}
err:
<code>[debug] props.content is string
[debug] props.content : **test**
Warning: React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: undefined. You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.
⨯ Error: Unsupported Server Component type: undefined
at stringify (<anonymous>)
at stringify (<anonymous>)
digest: "2642602426"
⨯ Error: Unsupported Server Component type: undefined
at stringify (<anonymous>)
at stringify (<anonymous>)
digest: "2642602426"
</code>
<code>[debug] props.content is string
[debug] props.content : **test**
Warning: React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: undefined. You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.
⨯ Error: Unsupported Server Component type: undefined
at stringify (<anonymous>)
at stringify (<anonymous>)
digest: "2642602426"
⨯ Error: Unsupported Server Component type: undefined
at stringify (<anonymous>)
at stringify (<anonymous>)
digest: "2642602426"
</code>
[debug] props.content is string
[debug] props.content : **test**
Warning: React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: undefined. You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.
⨯ Error: Unsupported Server Component type: undefined
at stringify (<anonymous>)
at stringify (<anonymous>)
digest: "2642602426"
⨯ Error: Unsupported Server Component type: undefined
at stringify (<anonymous>)
at stringify (<anonymous>)
digest: "2642602426"
I want to know why “children={props. content}” has problems
If I use “tag”, the same problem applies
<code><ReactMarkdown> {props.content} </ReactMarkdown>
</code>
<code><ReactMarkdown> {props.content} </ReactMarkdown>
</code>
<ReactMarkdown> {props.content} </ReactMarkdown>
What is the correct usage,This confuses me a lot