Reputation: 1228
I'm trying to use the size prop in PrimeReact's TreeTable component, but it's not having any effect. The TypeScript type indicates that the size prop should accept a number, but when I pass a value like size={10}, there's no noticeable difference in the table.
I even tried this in the official Prime React TreeTable Basic example example on StackBlitz, using the basic usage demo, but still no effect. Here's my code based on that example:
import { TreeTable } from 'primereact/treetable';
import { Column } from 'primereact/column';
export default function BasicDemo() {
const [nodes, setNodes] = useState([]);
useEffect(() => {
NodeService.getTreeTableNodes().then((data) => setNodes(data));
}, []);
return (
<div className="card">
<TreeTable size={10} value={nodes} tableStyle={{ minWidth: '100rem' }}>
<Column field="name" header="Name" expander></Column>
<Column field="size" header="Size"></Column>
<Column field="type" header="Type"></Column>
</TreeTable>
</div>
);
}
Upvotes: 0
Views: 79