我有一个函数,它有一些正在进行的承诺链,但这超出了重点。当我运行某个突变的refetch时,它会给我Uncaught (in promise) TypeError: Cannot read property 'refetch' of undefined。奇怪的是,如果我在它之前移除一个突变,它就会起作用。对于Apollo,我使用graphql HOC,它看起来像这样: name : 'getComp
我将状态(setActive)传递给ButtonsOur组件。此外,通过回调,我将setActive传递给HOC,但是我得到了这个错误"Uncaught : setActive不是一个函数“。在ButtonsOur组件中,我通过道具从父组件传递setActive。import HOC from '../../../hoc/
我写了一些HOC,我需要传递给这个HOC一个动态对象,它是我在某个生命周期级别上创建的,我没有让他作为道具。如果我尝试传递一些静态值(例如,从start初始化myObj ),它会按预期工作,并且我会得到正确的值。: class Hoc extends React.Component constructor...
我试着理解下面的临时反应; class HOC extends React.Component {WrappedComponent secretToLife={42} ); } return HOCwithSecretToLife(DisplayTheSecret);
export default W