0

While following a tutorial video, I encountered an issue with the rows and columns classes in bootstrap.

The instructor in the video made a div with a row class and al the items seemed to work perfectly. When trying to duplicate the same things, all my items just stack on top of each other in a single column rather than multiple. Even when the browser is at full screen.

Here is the link to the video (https://www.youtube.com/watch?v=-edmQKcOW8s&t=19375s) @ 1:51:52 is where the problem occurs

Any help would be greatly appreciated

export default class ProductList extends Component {
  render() {
    return (
      <React.Fragment>
        <div className="py-5">
          <div className="container">
            <Title name="our" title="products" />
            <div classname="row">
                <ProductConsumer>
                  {value => {
                    return value.products.map(product => {
                      return <Product key={product.id} product=
                      {product} />
                    })
                  }}
                </ProductConsumer>
              </div>
            </div>
          </div>
      </React.Fragment>
    )
  }
}

Expected result would be that on a full screen browser items would be listed in 4 columns.

1 Answer 1

1
  <div classname="row">

You have a typo here. It should be className.

Secondly, there is no col class in your code. Try adding this:

return(
    <div className="col-3">
        <Product key={product.id} product={product} />
    </div>
)
Sign up to request clarification or add additional context in comments.

2 Comments

Wow, that was it. Thank you. gonna go jump off a bridge now
@AndrewPython Great! Please don't forget to accept my answer, if it solves your problem.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.