Snippets

Shockoe Data Components Blog - React

Created by Michael Peter

File App.css Added

  • Ignore whitespace
  • Hide word diff
+.App {
+  text-align: center;
+}
+
+.App-header {
+  background-color: #282c34;
+  min-height: 100vh;
+  display: flex;
+  flex-direction: column;
+  align-items: center;
+  justify-content: center;
+  font-size: calc(10px + 2vmin);
+  color: white;
+}

File App.js Added

  • Ignore whitespace
  • Hide word diff
+import React, { Component } from 'react';
+import './App.css';
+import { renderPlatformUI, LoremIpsumData } from './shared/DataComponents.js';
+
+export default function App() {
+	return <LoremIpsumData render={renderPlatformUI(LoremIpsumUI)} />;
+}
+
+class LoremIpsumUI extends Component {
+	render() {
+		return (
+			<div className="App">
+				<header className="App-header">
+					<h1>WEB VERSION</h1>
+					<p>{this.props.text}</p>
+				</header>
+			</div>
+		);
+	}
+}
HTTPS SSH

You can clone a snippet to your computer for local editing. Learn more.