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
In our project, we encounter an issue with the page-size dropdown feature. Presently, we utilize state management for the select component, initializing it with an object as the default value. Here's a snippet of the current implementation:
The issue arises when different values are selected. The state, instead of being set as an object as initially defined ({ label: '25', value: '25' }), gets assigned a single value such as 25 or 100. This discrepancy is evident from the useEffect log.
Desired Solution:
We aim to ensure that the state retains an object structure similar to { label: '100', value: '100' } when updated with a different value selection.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
Hey Devs
Overview
In our project, we encounter an issue with the page-size dropdown feature. Presently, we utilize state management for the select component, initializing it with an object as the default value. Here's a snippet of the current implementation:
Code view
Below is the code snippet for the component responsible for the page-size dropdown:
The component is employed within the header section, as demonstrated here:
Problem:
The issue arises when different values are selected. The state, instead of being set as an object as initially defined ({ label: '25', value: '25' }), gets assigned a single value such as 25 or 100. This discrepancy is evident from the useEffect log.
Desired Solution:
We aim to ensure that the state retains an object structure similar to
{ label: '100', value: '100' }
when updated with a different value selection.How can we achieve that ?
Beta Was this translation helpful? Give feedback.
All reactions