handle undefined type

This commit is contained in:
SrGooglo 2023-04-03 16:23:23 +00:00
parent 3a26a9668d
commit 0fcb359eca

View File

@ -399,7 +399,7 @@ export class PostsListsComponent extends React.Component {
} }
{ {
this.state.list.map((data) => { this.state.list.map((data) => {
return React.createElement(typeToComponent[data.type ?? "post"], { return React.createElement(typeToComponent[data.type ?? "post"] ?? PostCard, {
key: data._id, key: data._id,
data: data, data: data,
events: { events: {