---
# System prepended metadata

title: React坑洞
tags: [React]

---

# React新手入坑筆記

## JsonRPC
1. 使用`OpenRPC Client JS`遇到`openrpc TypeError: events_1.EventEmitter is not a constructor`
- 解決方法([文章來源](https://stackoverflow.com/questions/69717406/typeerror-eventemitter-is-not-a-constructor-at-new-mapboxgeocoder)):
```bash=
npm i events
npm i --save-dev @types/events @types/node
```
2. JsonRPC格式
```jsonld=
{
   "jsonrpc": "2.0",
   "method": {{要调用的方法名称}},
   "params": {{方法所需的参数}},
   "id": {{请求的唯一标识符}}
}
```