Skip to content

Instantly share code, notes, and snippets.

@Manny27nyc
Created August 9, 2023 16:58
Show Gist options
  • Save Manny27nyc/52b11e8fd26be3721da987dabeff41b4 to your computer and use it in GitHub Desktop.
Save Manny27nyc/52b11e8fd26be3721da987dabeff41b4 to your computer and use it in GitHub Desktop.
jOQoYMe
<div id="root">
<!-- This div's content will be managed by React. -->
</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;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment