Skip to content
Discussion options

You must be logged in to vote

MRT handles making two instances of your Filter component when it's a range, so the first example just needs to be adjusted slightly to work with ranges.

To distinguish between the two generated components, a rangeFilterIndex is passed to the Filter-instance. So you'd need to do something like this in the range case

Filter: ({ column, rangeFilterIndex }) => (
    <LocalizationProvider dateAdapter={AdapterDayjs}>
        <DatePicker
            onChange={(newValue) => {
                column.setFilterValue((oldValues) => {
                    // Update the correct index of the filter value
                    const newValues = oldValues ?? ["", ""];
                    newValues[rangeFilt…

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
1 reply
@BrokeUniStudent
Comment options

Answer selected by BrokeUniStudent
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants