Is it possible to pass a placeholder value into the sortBy array inside the initialState of the useTable hook so that no sortBy is used depending on an external value? #3571
Unanswered
lilfrootyloops
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
My goal is to only use that specific default sorting depending on a study's status.
I'm able to conditionally change the sortBy value by using a ternary operator; however, it seems like the values I choose as placeholders aren't working as intended. I've tried passing in
null
and an empty{}
, butnull
returns an error and the empty{}
creates a reverse order.The following is my current structure:
I tried using an If statement and ternary outside of the sortBy; however, that gave me some syntax issues. Perhaps I formatted it wrong, but because those options didn't work for me, I tried putting the ternary inside of the sortBy, which seems to be working; however, I'm just confused as to what I should include as the alternative value in the ternary so that the default sorting is used.
I'd really appreciate any suggestions as to how I can implement what I'm trying to do.
Beta Was this translation helpful? Give feedback.
All reactions