gluestack

gluestack Logogluestack

dynamic values in classNames

onehat1 posted this in #support
Open in Discord
Avatar
onehat1OP
According to this Tailwind document - https://tailwindcss.com/docs/content-configuration#dynamic-class-names, we should not create dynamic class names like this:
<div className={top-[${top}px]}></div>

How am I supposed to dynamically set arbitrary values in classNames? Example: I want a Box to appear at an absolute position, based on where the user clicked. I get the top and left coordinates from the click event. Am I supposed to go back to using RN stylesheets for these properties?

1 Reply