JSX parser for .jsx
and .tsx
files.
This package is primarily used to rewrite JSX in JS files (think styled-jsx). This package does not parse JS, rather it finds JSX within JS.
go get github.com/matthewmueller/jsx
input := `export default () => <h1>hello world</h1>`
ast, _ := jsx.Parse("input.jsx", input)
fmt.Println(ast.String())
- Matt Mueller (@mattmueller)
MIT