.jsx File Extension
.jsx file is, how to open and transform JSX source, how Poly supports it, and when .js or .tsx is a better choice. File extension details for .jsx
Full Support| File type | JavaScript with JSX source |
|---|---|
| MIME type | None registered |
| Encoding | Unicode source text, normally UTF-8 |
| Operating systems | Windows, macOS, Linux, ChromeOS |
| Opens with | Visual Studio Code, WebStorm, Sublime Text, Babel |
| Poly support | Yes. Poly recognizes .jsx files as readable source code. |
| Indexed by Poly | Yes. Poly indexes readable source for exact and semantic search. |
| Preview in Poly | Yes. .jsx files open in Poly's read-only code editor. |
| Poly agent | Yes. The Poly agent can read and reason about the source without executing it. |
What kind of file is a .jsx?
A .jsx file contains JavaScript source with JSX, an XML-like syntax extension commonly used to describe user interfaces. JSX looks like HTML, but it follows different rules and can embed JavaScript expressions. React popularized JSX, although the syntax and React are separate and other libraries can use it too.1
There is no magic byte sequence that identifies JSX. It is Unicode text, and a reliable check requires a JSX-aware parser plus the surrounding project configuration. .jsx also has no dedicated IANA-registered MIME type. The registered text/javascript type lists .js and .mjs, not .jsx.2
Component.js to Component.jsx does not add JSX or transform the source. Likewise, renaming .jsx to .js does not compile JSX for a browser or runtime.How do I open a .jsx on my computer?
Open .jsx files on Windows, macOS, Linux, or ChromeOS with a code editor such as Visual Studio Code, WebStorm, or Sublime Text. Visual Studio Code provides a distinct JavaScript JSX language mode, which enables appropriate syntax highlighting and editing features.3
To run a project, use the toolchain declared by its package files and documentation. Browsers and ordinary JavaScript runtimes generally need JSX transformed first. Babel's JSX transform can produce JavaScript using either an automatic runtime or a configurable classic factory.4
.jsx project merely to inspect it. Source code, build plugins, package scripts, and imported dependencies can access whatever the runtime permits.Poly support for .jsx
Poly opens .jsx source in a read-only code editor with syntax highlighting, word wrap, and in-file search. Readable source is available to exact and semantic search, and the Poly agent can summarize components, explain props and state, or reason about the code.
Poly does not execute the file, install dependencies, run its build, or automatically resolve imports. Preview is useful for inspection, but it is not a security verdict and cannot establish the behavior of an entire application from one file.
History of .jsx
JSX became closely associated with React, which was open-sourced by Facebook on May 29, 2013.5 The .jsx suffix developed as a practical signal that a JavaScript file needs a JSX-aware parser or transform. It remains a convention rather than a separate standardized programming language or media type.
The convention now extends beyond React. TypeScript describes JSX as implementation-specific and notes that its preserve mode emits unchanged JSX with a .jsx output suffix.6 Different toolchains can therefore assign different runtime meanings to the same JSX elements.
Working with .jsx and alternatives
Choose the suffix that matches both the source syntax and the project's configured tools:
| Extension | Best fit | Key distinction |
|---|---|---|
.jsx | JavaScript source containing JSX | Clearly signals that JSX parsing is required |
.js | Standard JavaScript, or JSX where the toolchain permits it | The suffix alone does not signal JSX |
.tsx | TypeScript source containing JSX | Adds TypeScript syntax and type checking |
React's TypeScript guidance requires .tsx for files that combine TypeScript and JSX.7 Converting .jsx to .tsx usually requires adding or fixing types, not simply changing the filename. Transforming JSX with Babel or another compiler produces JavaScript output, while renaming leaves the source unchanged.
Keep build configuration, dependency manifests, and lockfiles with shared JSX source. They identify the JSX runtime, transform settings, module system, and package versions needed to interpret the code correctly.
Footnotes
- React. Writing Markup with JSX. ↩
- Internet Assigned Numbers Authority. text/javascript Media Type Registration. ↩
- Visual Studio Code. Language Identifiers. ↩
- Babel. @babel/plugin-transform-react-jsx. ↩
- React. React Versions: Initial Commit. ↩
- TypeScript. JSX. ↩
- React. Using TypeScript. ↩