We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
renderNothing和它的名字一样,它是一个返回null的高阶组件
renderNothing
null
renderNothing: HigherOrderComponent
const { compose, branch, renderNothing } = Recompose; const Bar = () => (<p>Bar</p>); const Foo = compose( branch( props => props.isShow, () => Bar, renderNothing, ), )(({ title }) => ( <div>{ title }</div> )) class App extends React.Component { render() { return ( <div> 什么组件也不展示 <Foo isShow={false} /> </div> ); } } ReactDOM.render(<App />, document.getElementById('app'))
在codepen在线预览
The text was updated successfully, but these errors were encountered:
No branches or pull requests
renderNothing 介绍
renderNothing
和它的名字一样,它是一个返回null
的高阶组件renderNothing Flow Type
renderNothing 例子
在线DEMO
在codepen在线预览
The text was updated successfully, but these errors were encountered: