Check out example codes for "css grid vs flexbox". It will help you in understanding the concepts better.

Code Example 1

/* Answer to: "css grid vs flexbox" */

  Grid is much newer than Flexbox and has a bit less browser
  support. That’s why it makes perfect sense if people are
  wondering if CSS grid is here to replace Flexbox.

  To be exact:
  1. Grid can do things Flexbox can’t do.
  2. Flexbox can do things Grid can’t do.
  3. They can work together: a grid item can be a flexbox container.
  A flex item can be a grid container.

  For more information on this topic, go to:

Code Example 2

.wrapper {
  display: grid;
  grid-template-columns: repeat(auto-fill, 200px);

Learn ReactJs, React Native from