TS Lint Error on title prop in Accordion component
When a ReactNode or JSXElement is passed to the title prop in the Accordion sections array, it throws an error.
Types of property 'title' are incompatible.
Type 'ReactNode' is not assignable to type 'string | undefined'.
Type 'null' is not assignable to type 'string | undefined'.
However, the documentation says it accepts a ReactNode for further title customisation.
Weird, the AccordionSection does accept ReactNode:
https://github.com/canonical/react-components/blob/ab70886f9350584c219318636e919dc25a8bc8e6/src/components/Accordion/AccordionSection/AccordionSection.tsx#L28-L31
And we do have example where nodes are passed to the title:
https://github.com/canonical/react-components/blob/ab70886f9350584c219318636e919dc25a8bc8e6/src/components/Accordion/Accordion.stories.tsx#L195-L204
Could there be something else that is wrong/different? Would you he able to try our storybook example in your env to see if that works?
Hey @bartaz, I completely forgot about this. The problem may have been that our Vanilla version was outdated (I'm not sure). But checking where we implemented this, I don't see the error anymore (we've updated Vanilla several times since I created this issue).
Thanks for the reply! Apologies for not following up on this. I'll be closing this now.