We often want to adjust CSS classes based on dynamic properties sent to a component. There are a number of ways to accomplish this, including the dreaded nested ternary.
I really like using JavaScript objects to make it easy to map a series of classes to a component, based on the value of a prop.
#react #css #nextjs #tutorial
コメント