Documentation
¶
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Parse ¶
Parse a .jsx or .tsx file and return an AST
Example ¶
package main
import (
"fmt"
"github.com/matthewmueller/jsx"
)
func main() {
input := `export default () => <h1>hello world</h1>`
ast, err := jsx.Parse("input.jsx", input)
if err != nil {
fmt.Println(err)
}
fmt.Println(ast.String())
}
Output: export default () => <h1>hello world</h1>
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.