Topic: 4.24.0 version breaking
Venky free asked 5 years ago
Expected behavior
Conditional rendering has to happen properly.
Actual behavior
When try to return DOM elements inside the MDBCardFooter component nothing is rendering, showing empty DOM element instead.
If it's a simple text the DOM is getting rendered, otherwise not.
<MDBCardFooter>Sample text is getting rendered...</MDBCardFooter>
But not the below code
Resources (screenshots, code snippets etc.)
var data = [{
"type": "text",
"text": "sslskdjf laskdj lakkjd l;aieujdf;lwkasdclaksdliwaelkcn als kldakjsd lkasjdlajeksdx.,kan sL,dna"
}, {
"type": "text",
"text": "kldakjsd lkasjdlajeksdx.,kan sL,dna"
}, {
"type": "text",
"text": "sslskdjf laskdj lakkjd l;aieujdf;lwkasdclaksdliwaelkcn als kldakjsd lkasjdlajeksdx.,kan sL,dna"
}, {
"type": "text",
"text": "kldakjsd lkasjdlajeksdx.,kan sL,dna"
}
];
<MDBCardFooter>
{
data.map((d, di) => {
return (
<div key={di}>
<span>{d.type}</span>
<span>{d.text}</span>
</div>
);
})
}
</MDBCardFooter>
Please check this
Thanks :)
Piotr Glejzer staff answered 5 years ago
Hi,
Thanks for your message. Yes, you have a right. There is a little bug with this. We forgot to add 'children' prop to the component. It will be fixed in the next release. Have a nice day.
Best regards,
Piotr
FREE CONSULTATION
Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.
Answered
- ForumUser: Free
- Premium support: No
- Technology: MDB React
- MDB Version: 4.24.0
- Device: Any
- Browser: Any
- OS: Any
- Provided sample code: No
- Provided link: No