Bug report: React slot renderer not working in child rows
Bug report: React slot renderer not working in child rows

Using React Datatables, I have following slot rendering component:
function BoolToYesNo({ value }) {
if (value === true) {
return (
<>
<i className="fa fa-check-circle success"></i> Yes
</>
);
} else {
return (
<>
<i className="fa fa-times-circle-o danger"></i> No
</>
);
}
}
When the component is rendered in "whole row", it displays correctly:
When the component is rendered in "child row", it doesn't display correctly:
Replies
How are you creating the child row?
Allan
I just import this:
import "datatables.net-responsive-dt";
And then I use these options:
And here is the actual DataTable to be rendered:
Finally, when the table is rendered, I reduce the width of the page so that "Notifications allowed", "Emails allowed" and "SMS notifications allowed" columns are automagically moved to the child rows.
Regarding my issue, I tried to inspect some datatables.net-react code.
In the following function, the if statement blocks contain identical code:
Are those identical code blocks a bug?
Oh, this is for Responsive's child rows, not your own?
Try using the
listHiddenNodes
renderer for Responsive, an example for which is available here.Allan
I'm importing the React version of DataTable:
import DataTable from "datatables.net-react";
This is what my 'responsive' option looks like:
I get "TypeError: Cannot read properties of undefined (reading 'renderer')"
"Oh, this is for Responsive's child rows, not your own?"
Yes.