You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For the examples codes in the documentation section Custom Faceted Values, the functions getFacetedUniqueValues and getFacetedMinMaxValues expects as return a callback that returns a Map/Array and not a Map/Array itself, respectivetely. Below is a screenshot from the source code
The correct example in the doc should be
consttable=useMaterialReactTable({
columns,
data,enableFacetedValues: true,//if using server-side pagination and filteringgetFacetedMinMaxValues: (table)=>{//fetch min and max values from serverreturn()=>[minValue,maxValue];},//if using server-side filteringgetFacetedUniqueValues: (table)=>{constuniqueValueMap=newMap<string,number>();//fetch unique values from server, ideally including the count of each unique valuereturn()=>uniqueValueMap;},})
Also I wonder why the return of a callback, instead of a direct Map/Array for this functions. Is there any explanation on that?
Minimal, Reproducible Example - (Optional, but Recommended)
N/A
Screenshots or Videos (Optional)
N/A
Do you intend to try to help solve this bug with your own PR?
None
Terms
I understand that if my bug cannot be reliably reproduced in a debuggable environment, it will probably not be fixed and this issue may even be closed.
The text was updated successfully, but these errors were encountered:
material-react-table version
N/A
react & react-dom versions
N/A
Describe the bug and the steps to reproduce it
For the examples codes in the documentation section Custom Faceted Values, the functions
getFacetedUniqueValues
andgetFacetedMinMaxValues
expects as return a callback that returns a Map/Array and not a Map/Array itself, respectivetely. Below is a screenshot from the source codeThe correct example in the doc should be
Also I wonder why the return of a callback, instead of a direct Map/Array for this functions. Is there any explanation on that?
Minimal, Reproducible Example - (Optional, but Recommended)
N/A
Screenshots or Videos (Optional)
N/A
Do you intend to try to help solve this bug with your own PR?
None
Terms
The text was updated successfully, but these errors were encountered: