I used create-react-app to initialize my app. Then I did npm install semantic-ui-react --save to install the package.
I want to create this Grid example from https://react.semantic-ui.com/collections/grid#grid-example-divided-number:
I created a file called Grid.js:
import React from 'react'
import { Grid } from 'semantic-ui-react'
const GridExample = () => (
<Grid columns={3} divided>
<Grid.Row>
<Grid.Column>
<p>Lorem Ipsum</p>
</Grid.Column>
<Grid.Column>
<p>Lorem Ipsum</p>
</Grid.Column>
<Grid.Column>
<p>Lorem Ipsum</p>
</Grid.Column>
</Grid.Row>
<Grid.Row>
<Grid.Column>
<p>Lorem Ipsum</p>
</Grid.Column>
<Grid.Column>
<p>Lorem Ipsum</p>
</Grid.Column>
<Grid.Column>
<p>Lorem Ipsum</p>
</Grid.Column>
</Grid.Row>
</Grid>
)
export default GridExample
Then in App.js I imported GridExample:
import React, { Component } from 'react';
import GridExample from './Grid'
import logo from './logo.svg';
import './App.css';
class App extends Component {
render() {
return (
<div className="App">
<div className="App-header">
<img src={logo} className="App-logo" alt="logo" />
<h2>Welcome to React</h2>
</div>
<GridExample />
</div>
);
}
}
export default App;
However, when the web page loads the <p> elements are stacked on top of each other - as if 6X1 instead of the intended 2X3
Why is the Grid not being rendered properly?
