Should my custom Cell renderer return null or empty string when no value to format? #3438
Unanswered
jestrickler
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.
-
Any considerations on why the Cell default is
({ value }) => String(value)
rather than({ value }) => (value ? String(value) : null)
?I take the 2nd approach in my custom cell renderers and I think that's typical react logic, but then I was writing tests around some missing data situations and found
toBeEmptyDOMElement()
was failing with empty string for the default renderer while passing for my renderer.toHaveTextContent('')
passes for all which I find odd, you'd think those 2 methods would be simpatico.Beta Was this translation helpful? Give feedback.
All reactions