You should not use <Link> outside a

后端 未结 10 1742
既然无缘
既然无缘 2020-11-27 15:55

I\'m trying to set up react-router in an example application, and I\'m getting the following error:

You should not use  outside a 
         


        
10条回答
  •  鱼传尺愫
    2020-11-27 16:14

    For JEST users

    if you use Jest for testing and this error happen just wrap your component with

    describe('Test suits for MyComponentWithLink', () => {
    it('should match with snapshot', () => {
    const tree = renderer
      .create(
        
          
        
      )
      .toJSON();
     expect(tree).toMatchSnapshot();
     });
    });
    

提交回复
热议问题