Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

add conditional attribute jsx react

return (
 <Button {...(condition ? {className: 'btn btn-primary'} : {})} />
);
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #add #conditional #attribute #jsx #react
ADD COMMENT
Topic
Name
2+1 =