I am using React and React-Table version 7. It is working well for me, but I want to add a checkbox to my top-level header. So I tried it like this:
const columns = React.useMemo(
() => [
{
Header: 'Monster Types <input type="checkbox" id="horns" name="horns">',
columns: [
{
Header: 'Possible Dungeons',
accessor: 'dungeonNames',
Cell: ({ row }) => <div>{row.original.dungeonNames.join(', ')}</div>,
Filter: TraineeSelectColumnFilter,
sortType: "basic",
filter: 'includes'
},
{
Header: 'Monsters',
accessor: 'monsterNames',
...
But when I do that, it just prints out the HTML and not the actual checkbox.
So it looks like this:
Monster Types<input type="checkbox" id="horns" name="horns">
Does anyone know of a way to add an HTML input beside a React-Table header?
Thanks!