Created
August 28, 2019 10:03
-
-
Save asis/39e57ef94f97898240d545ee17f3aadc to your computer and use it in GitHub Desktop.
This file contains hidden or 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 LibraryPen from "some-library"; | |
const SecretNote = ({ pen }) => ( | |
<span>🕵️♀️{React.cloneElement(pen, { text: "this is a secret" })}🕵️♀️</span> | |
); | |
const AdaptedPen = ({ text }) => <LibraryPen write={text} />; | |
const App = () => <SecretNote pen={<AdaptedPen />} />; | |
ReactDOM.render(<App />, document.getElementById("app")); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment