gaearon / gaearon/react-hot-loader

when props include "this"

Open
#1,764 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
12.2k
Forks
775
PR merge metrics
No merged PRs in 30d

Description

### Description

What you are reporting:
`this` failed to be resolved.

I do what follows show:
```ts
class EmojiView extends EventEmitter {
...
mock() {
ReactDOM.render(, element)
}
...
}
```
just want to emit some events out of react env.
### Expected behavior

What you think should happen:

### Actual behavior

What actually happens:
but reported:
![image](https://user-images.githubusercontent.com/40891547/140958044-b8e4bdc2-bb24-42ff-ab71-3344db313e88.png)

![image](https://user-images.githubusercontent.com/40891547/140956221-e426e71f-99e5-46bc-9fb5-f925910068f4.png)
it seems like type-define error confronting `this`

### Environment

React Hot Loader version: 4.13

Run these commands in the project folder and fill in their results:

1. `node -v`: 16.5.0
2. `npm -v`: 7.19.1

Then, specify:

1. Operating system: windows 11
2. Browser and version: edge chromium 95.0.1020.44

### Reproducible Demo

no concrete demo, this bug ocured in compilation time:
![image](https://user-images.githubusercontent.com/40891547/141035694-640a135c-76c0-4a6c-9961-ce2cfffbf99e.png)
![image](https://user-images.githubusercontent.com/40891547/141035745-64755f24-f753-4033-a2ab-da44458ef1cc.png)

repos: [clickme](https://github.com/www159/react-issue.git)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.