Inactive And Active Component Styles With Radium
import React from 'react';
import Radium from 'radium';
const styles = {
base: {
textDecoration: "none",
color: "gray",
},
active: {
color: "black",
backgroundColor: "lightgray",
},
};
let NavItem = ({ label, path, active }) => {
return (
<a
href={path}
style={[
styles.base,
styles[active && 'active'],
]}
>{label}</a>
);
};
NavItem = Radium(NavItem);Last updated