在我的React应用程序中,我使用的是非空断言(!)告诉TS,来自useContext钩子的值不是null。它工作得很好,似乎是非空断言的教科书用例,但是对于推荐的eslint规则,非空断言是一个警告。return state.user ?// Dashboard.tsx
const { state } = R
我正在使用,当我在我的设备上运行应用程序时,它工作得很好。TypeError: Cannot read property 'default' of undefined
at constructClassInstance (node_modules/react-test-renderer/cjs/react-test-renderer.developme