尝试导入错误:未从“ mobx”导出“ makeObservable”

时间:2020-10-09 02:53:18

标签: reactjs mobx mobx-react-lite

import React from 'react'
import { observer } from 'mobx-react'; //Cause of Error

export default observer(App); //At the bottom of the code

唯一引起错误的行是import { observer } from 'mobx-react';,并给我以下错误

./node_modules/mobx-react-lite/es/utils/assertEnvironment.js
Attempted import error: 'makeObservable' is not exported from 'mobx'.

1 个答案:

答案 0 :(得分:0)

将 mobx 更新到最新版本并重试