Skip to content

React sample doesn't work #30

Description

@JasonGoemaat

In README.md it says one way to import when using react (adding { ReactDOM }and has another way in the sample code, but neither works for me. I did find a way that works when creating a tsx file. I don't know if I've done something wrong or maybe the README just needs to be updated...

// COMPILES, but in game gives ERROR: Module not found: "@react"
// import React from '@react';

// COMPILES, but in game gives ERROR: Module not found: "react"
// import React from 'react';

// BUILD ERROR:  Module '"@react"' has no exported member 'ReactDOM'
// import React, { ReactDOM } from "@react"

// WORKS!
import ReactNamespace from 'react/index';
declare var React: typeof ReactNamespace;

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions