Skip to content

Instantly share code, notes, and snippets.

@RoboPhred
RoboPhred / monaco-react-tsx.ts
Created April 6, 2018 23:54
Monaco playground snippet for TSX support
// The Monaco Editor can be easily created, given an
// empty container and an options literal.
// Two members of the literal are "value" and "language".
// The editor takes the full size of its container.
// Important Bit #1: Typescript must see the 'file' it is editing as having
// a .tsx extension
const modelUri = monaco.Uri.file("foo.tsx")
// Important Bit #2