- Function.is_jsx - Check if a function contains JSX elements
- Class.jsx_elements - Get all JSX elements in a class
- Function.jsx_elements - Get all JSX elements in a function
- JSXElement - Manipulate JSX elements
- JSXProp - Manipulate JSX props
Detecting React Components with is_jsx
Graph-sitter exposes a is_jsx property on both classes and functions, which can be used to check if a symbol is a React component.
Working with JSX Elements
Given a React component, you can access its JSX elements using the jsx_elements property. You can manipulate these elements by using the JSXElement and JSXProp APIs.Common React Operations
Refactoring Components into Separate Files
Split React components into individual files:See Moving Symbols for more details
on moving symbols between files.