TypeError:对象不是函数/ react-spring动画库

时间:2019-10-16 12:12:13

标签: reactjs react-spring

我已经重写了所有内容,但仍然出现以下错误:

TypeError: Object is not a function. (In 'Object(react__WEBPACK_IMPORTED_MODULE_2_["forwardRef"])', 'Object' is an instance of Object)_

我首先在单独的jsx中制作了动画div,然后将其导入到App.js中,这首先导致了错误。 然后将动画div包含到App.js中,希望它可以使我更清晰地了解并帮助我检测错误。

很遗憾,我无法解决上述错误。

环境: “反应弹簧”:“ ^ 8.0.27” “ react”:“ ^ 16.2.0”

const App = () => {
const fade = useSpring(
    {from: {opacity: 0},
     opacity: 1
});

return(
      <div style={{width: '100%', margin: 'auto'}}>
          <Grid className="landing-grid">
              <Cell col={12}>
                  <img
                      src={logo}
                      alt="LocksBridge"
                      className="avatar-img"
                  />


                  <animated.div style={fade}>
                      <div style={{fontSize: '1.7em', color: '#f5f5f5'}} >aesthetic</div>
                      <div style={{fontSize: '1.7em', color: '#f5f5f5'}}> artist</div>
                      <div style={{fontSize: '1.7em', color: '#f5f5f5'}}> social</div>
                  </animated.div>

              </Cell>

          </Grid>
      </div>
  );
  };

  export default App;

0 个答案:

没有答案