Skip to main content
GraphSitter exposes several React and JSX-specific APIs for working with modern React codebases. Key APIs include:
See React Modernization for tutorials and applications of the concepts described here

Detecting React Components with is_jsx

Codegen 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

See React Modernization for more

Refactoring Components into Separate Files

Split React components into individual files:
See Moving Symbols for more details on moving symbols between files.

Updating Component Names and Props

Replace components throughout the codebase with prop updates: