I have the following object map:
const stylesMap = {
level: {
1: "text-5xl",
...
},
};
In my component I have:
const ComponentExample = (props) => {
const { level } = props;
return (
<h1 className={classNames(stylesMap.level[level ?? stylesMap.level[1]])}>
Test
</h1>
);
};
As a test I have made level: null expecting the values "text-5xl" to be part of the classNames list but I don't see it. I'm simply trying to set default values if the props are null.
I even add safelist: ["text-5xl"] in the tailwindcss config but that didn't work even though its already picked up in stylesMap Am I missing anything?