React - inline styling

0 votes
202 views
added Mar 8, 2019 in React by LC Marshal Captain (25,790 points)
import React from 'react';

const containerStyle = {
  padding: '20px',
  border: '5px solid #000'
};
const contentStyle = {
  fontSize: '15px',
  textAlign: 'center'
};

const MainPage = () => (
  <div style={containerStyle}>
    <div style={contentStyle}>Content goes here</div>
  </div>
);

export default MainPage;

 

lazacode.org - Malaysia's programming knowledge sharing platform, where everyone can share their finding as reference to others.
...