T
TanStack3y ago
exotic-emerald

Not getting values from my getValue() function.

I am calling my getValue() function but it is not returning me any values. tsx // initializing column helper function with argument type similar to that of column object parameters data type value. const columnHelper = createColumnHelper<typeof columns>(); // getting the values of keys for displaying header fields const columns = useMemo( () => Object.keys(metaData[0]).map((key, id) => { return columnHelper.accessor(key.toString(), { header: key.toUpperCase(), }); }), [] ); const defaultColumn = { cell: (props) => { console.log(props); <input value={props.getValue()} />; }, }; const table = useReactTable({ data, columns, defaultColumn, getCoreRowModel: getCoreRowModel(), }); const handleTableRowHandler = ( id, value, e: React.MouseEvent<HTMLElement> ) => { e.preventDefault(); if (isSelected === id) { setIsSelected(null); } else { setIsSelected(id); // navigate(navPath!, { // state: value, // }); setEditRowData(value); // console.log(value); } };
0 Replies
No replies yetBe the first to reply to this messageJoin

Did you find this page helpful?