Replies: 2 comments 2 replies
-
Simply do
Nevertheless, nested classes based on multiple conditions are hard to read.
|
Beta Was this translation helpful? Give feedback.
2 replies
-
One thing you can do, since you’re using React, is create a component so you can nest classes one by one: const Apply = ({ className, children }) => (
React.cloneElement(children, {
...children.props,
className: className + (!children.props.className ? "" : " " + children.props.className),
})
)
<Apply className="<string>">
<Apply className={/* Can be expression */}>
<Apply className="<string>">
{/* You code here */}
</Apply>
</Apply>
</Apply> I haven’t tested this but in theory you’re just breaking |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi I have a button like this. Yes className so longggggggggggggggg because I just want to add
cursor-not-allowed
Is this will work?
w-1/4 ml-2 ${loading&&"cursor-not-allowed"} group relative flex justify-center items-center py-2 px-4 border border-transparent text-sm leading-5 font-medium rounded-md text-white bg-gray-900 hover:bg-indigo-500 focus:outline-none focus:border-indigo-700 focus:shadow-outline-indigo active:bg-indigo-700 transition duration-150 ease-in-out
Beta Was this translation helpful? Give feedback.
All reactions