Last active
September 24, 2017 07:48
-
-
Save koba04/48756a6d6020d99bbdca2d6216fd6878 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 React from 'react'; | |
import TestRenderer from 'react-test-renderer'; | |
const Text = (props) => <p>{props.children}</p>; | |
const App = () => ( | |
<section> | |
<h1>Hello</h1> | |
<Text>hogehoge</Text> | |
</section> | |
); | |
const renderer = TestRenderer.create(<App />); | |
renderer.toJSON(); | |
// {"type":"section","props":{},"children":[{"type":"h1","props":{},"children":["Hello"]},{"type":"p","props":{},"children":["hogehoge"]}]} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment