Skip to content

[Packager] Support for jsx filenames in React Native #2303

@pickhardt

Description

@pickhardt

It seems that files with the extension .js can be required, but .jsx files cannot.

The following works fine:

var HelloPage = require("./src/views/screens/hello.js")
But when I rename the file and the code to .jsx, it gives the exception "Requiring unknown module "./src/views/screens/hello.jsx". If you are sure the module is there, try restarting the packager."

Restarting didn't seem to help. Is this a problem with something in React Native?

I want to name the files with JSX so that my editor uses the right syntax highlighter.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions