REACT 6

  • 1

  • 1

  • 1

  • 1

We use objects to dynamically style components, using JSX brackets.

//remember that style needs double {}
const picture={
  url: "https://.../635258.jpg",
  width: 100,
  height: 100
}

function Imma({pic}){
  return (
    <img 
      className= {cubo}
      src= {pic.url}
      style={{
        height: pic.height + "px",
        width: pic.width + 30 + "px"
      }}
    />
  )
}

On the DOM we pass the style object prop to the component.

We install the classnames utility to join JSX classes conditionally.

DOM element animated with a classname object

We need to use flexGrow:0 for the nav elements justify and a custom-fill SVG for the React-bootstrap collapse icon.

Navbar and Navbar collapse on React-Bootstrap

We can edit the .carousel-indicators and .carousel-control-prev-icon (SVG) in the CSS.

Carousel with image imageBar + border current image

1

Last updated