I have some conditional styling based on if a certain value exist. The value can exist or can be null
background-color: ${myPropValue.myKey !== null ? 'pink' : 'green'};
This works fine. However I need to add some more conditional styling based on the same logic in this file.
I try to create a function which I can reuse:
const hasMyPropValue = ({ myPropValue }: Pick<MyType, 'myPropValue'>) =>
myPropValue.myKey !== null;
When I want to use it like background-color: ${hasMyPropValue() ? 'pink' : 'green'};
I get a linting error: Expected 1 arguments, but got 0.ts(2554)
I just want it to return true or false?