React and Flex layout how to use them

Viewed 19805

I am trying to use React and flexbox.Normally i can use flexbox at react native but icouldnt achive in react.js

this is my Css file

.wrapper, html, body {
    height:100%;
    margin:0;
    position:absolute;
}
.wrapper {
    display: flex;
    flex-direction: column;
}
.nav {
    background-color: red;
    flex:1
}
.main {
    background-color: blue;
    flex:1
}

This is my js file

import React, { Component } from 'react';
import './background.css';
import { Icon } from 'semantic-ui-react'
import Navbar from './navbar'

class Back extends Component {



  render() {
    return (
      <div className="wrapper">
          <div className="nav"></div>
          <div className="main"></div>
       </div>
    );
  }
}

export default Back;

I got just a white screen what might be a problem ?

Thank you

2 Answers

You can also use float:left in the wrapper class.

Related