How to use the inferno-router.withRouter function in inferno-router

To help you get started, we’ve selected a few inferno-router examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github Paturages / chorus / src / app / components / organisms / NavBar / index.jsx View on Github external
>
              gh3orus
            
            {/*  */}
            {/*
              TODO: Uncomment when feeling like implementing Discord auth
              
            */}
          
        
      
    );
  }
}

export default withRouter(NavBar);
github infernojs / inferno / packages / inferno-router / __tests__ / withRouter.spec.jsx View on Github external
it('provides the parent match as a prop to the wrapped component', () => {
    let parentMatch;
    const PropsChecker = withRouter(props => {
      expect(props.match).toEqual(parentMatch);
      return null;
    });

    render(
      
         {
            parentMatch = match;
            return ;
          }}
        />
      ,
      node
    );
github infernojs / inferno / packages / inferno-router / __tests__ / withRouter.spec.jsx View on Github external
it('exposes the instance of the wrapped component via wrappedComponentRef', () => {
    class WrappedComponent extends Component {
      render() {
        return null;
      }
    }
    const TestComponent = withRouter(WrappedComponent);

    let ref;
    render(
      
          (ref = r)} />} />
      ,
      node
    );

    expect(ref instanceof Component).toBe(true);
  });
github infernojs / inferno / packages / inferno-router / __tests__ / withRouter.spec.jsx View on Github external
it('hoists non-react statics from the wrapped component', () => {
    class TestComponent extends Component {
      static foo() {
        return 'bar';
      }

      render() {
        return null;
      }
    }
    TestComponent.hello = 'world';

    const decorated = withRouter(TestComponent);

    expect(decorated.hello).toBe('world');
    expect(typeof decorated.foo).toBe('function');
    expect(decorated.foo()).toBe('bar');
  });
});
github infernojs / inferno / packages / inferno-router / __tests__ / withRouter.spec.jsx View on Github external
it('exposes the wrapped component as WrappedComponent', () => {
    const TestComponent = () =&gt; <div>;
    const decorated = withRouter(TestComponent);
    expect(decorated.WrappedComponent).toBe(TestComponent);
  });
</div>
github infernojs / inferno / packages / inferno-router / __tests__ / withRouter.spec.jsx View on Github external
it('provides the staticContext prop', () =&gt; {
      const PropsChecker = withRouter(props =&gt; {
        expect(typeof props.staticContext).toBe('object');
        expect(props.staticContext).toBe(context);
        return null;
      });

      const context = {};

      render(
        
          
        ,
        node
      );
    });
  });
github bs32g1038 / node-blog / blog / src / admin / components / AppHeader.jsx View on Github external
<header>
        <h1><i></i>{config.site.name}后台</h1>
        <nav>
          <div>
            <i></i>文章管理
            <i></i>评论管理
            <i></i>分类管理
            <i></i>留言管理
            <a> this.loginOut()}&gt;<i></i>注销</a>
          </div>
        </nav>
      </header>
    )
  }
}
export default withRouter(AppHeader)
github bs32g1038 / node-blog / blog / src / admin / components / CommentReply.jsx View on Github external
minHeight: "80px",
                                    maxHeight: "115px",
                                    width: "550px"
                                }}&gt;
                        
                        <div>
                            <label>操作:</label>
                            <button type="submit">发布</button>
                        </div>
                    
                
            
        )
    }
}
export default withRouter(CommentReply);
github bs32g1038 / node-blog / blog / src / admin / components / ArticleEdit.jsx View on Github external
<div>
                            <label>文章详情:</label>
                             this.onChange(value)} /&gt;
                        </div>
                        <div>
                            <label>操作:</label>
                            <button type="submit">发布</button>
                            <button id="save_draft">存为草稿</button>
                        </div>
                    
                
            
        )
    }
}
export default withRouter(ArticleEdit);

inferno-router

Provides routing functionality for Inferno

MIT
Latest version published 5 months ago

Package Health Score

79 / 100
Full package analysis