Skip to content

Instantly share code, notes, and snippets.

@h4091
Last active December 28, 2018 16:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save h4091/2d9c22b7ee2d6048fd16b271573b18c4 to your computer and use it in GitHub Desktop.
Save h4091/2d9c22b7ee2d6048fd16b271573b18c4 to your computer and use it in GitHub Desktop.
Test23
<div id="root"></div>
function Contacts() {
return <div className="Contacts" />;
}
function Chat() {
return <div className="Chat" />;
}
function SplitPane(props) {
return(
<div className="SplitPane">
<div className="SplitPane-left">
{props.left}
</div>
<div className="SplitPane-right">
{props.right}
</div>
</div>
);
}
function App() {
return(
<SplitPane left={<Contacts />} right={<Chat />} />
);
}
ReactDOM.render(
<App />,
document.getElementById("root")
);
<script src="https://unpkg.com/react/umd/react.development.js"></script>
<script src="https://unpkg.com/react-dom/umd/react-dom.development.js"></script>
html, body, #root {
width: 100%;
height: 100%;
}
.SplitPane {
width: 100%;
height: 100%;
}
.SplitPane-left {
float: left;
width: 30%;
height: 100%;
}
.SplitPane-right {
float: left;
width: 70%;
height: 100%;
}
.Contacts {
width: 100%;
height: 100%;
background: lightblue;
}
.Chat {
width: 100%;
height: 100%;
background: pink;
}

Test23

Learn the fundamentals of React, including simple and class components, state, props, and submitting form data.

Containment

A Pen by 你银子掉了 on CodePen.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment