Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

react conditional classname class

import React from "react";
2
3const Banner = ({ active, children }) => (
4  <div className={`banner ${active ? "active" : ""}`}>{children}</div>
5);
6
7export default Banner;
Source by www.pluralsight.com #
 
PREVIOUS NEXT
Tagged: #react #conditional #classname #class
ADD COMMENT
Topic
Name
8+8 =