Skip to content

Instantly share code, notes, and snippets.

@basarat
Last active August 22, 2018 00:49
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 basarat/5e2b0bb0d115c1732f63a96f3125a1c6 to your computer and use it in GitHub Desktop.
Save basarat/5e2b0bb0d115c1732f63a96f3125a1c6 to your computer and use it in GitHub Desktop.
Debug JavaScript objects in TypeScript React
export const Pre: React.SFC<{ children: any }> = (props) => {
return <pre>{JSON.stringify(props.children, null, 2)}</pre>
}
import {Pre} from './pre';
// in some render
render() {
return <Pre>{{example: 123}}</Pre>
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment