Last active
December 31, 2018 16:46
-
-
Save silicakes/5a7490fe3deffcb3b752ba883ca0a05a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import * as React from "react"; | |
import { render } from "react-dom"; | |
import "./styles.css"; | |
function App(props) { | |
return ( | |
<div className="App"> | |
<h1> {props.text}</h1> | |
</div> | |
); | |
} | |
const hoc = Component => React.cloneElement(Component, { text: "Cat" }); | |
const rootElement = document.getElementById("root"); | |
render(hoc(<App text="dog" />), rootElement); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment