Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
>
gh3orus
{/* */}
{/*
TODO: Uncomment when feeling like implementing Discord auth
*/}
);
}
}
export default withRouter(NavBar);
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
);
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);
});
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');
});
});
it('exposes the wrapped component as WrappedComponent', () => {
const TestComponent = () => <div>;
const decorated = withRouter(TestComponent);
expect(decorated.WrappedComponent).toBe(TestComponent);
});
</div>
it('provides the staticContext prop', () => {
const PropsChecker = withRouter(props => {
expect(typeof props.staticContext).toBe('object');
expect(props.staticContext).toBe(context);
return null;
});
const context = {};
render(
,
node
);
});
});
<header>
<h1><i></i>{config.site.name}后台</h1>
<nav>
<div>
<i></i>文章管理
<i></i>评论管理
<i></i>分类管理
<i></i>留言管理
<a> this.loginOut()}><i></i>注销</a>
</div>
</nav>
</header>
)
}
}
export default withRouter(AppHeader)
minHeight: "80px",
maxHeight: "115px",
width: "550px"
}}>
<div>
<label>操作:</label>
<button type="submit">发布</button>
</div>
)
}
}
export default withRouter(CommentReply);
)
}
}
export default withRouter(App);
<div>
<label>文章详情:</label>
this.onChange(value)} />
</div>
<div>
<label>操作:</label>
<button type="submit">发布</button>
<button id="save_draft">存为草稿</button>
</div>
)
}
}
export default withRouter(ArticleEdit);