react props.children proptype
import PropTypes from 'prop-types'
...
static propTypes = {
children: PropTypes.oneOfType([
PropTypes.arrayOf(PropTypes.node),
PropTypes.node
]).isRequired
}
react props.children proptype
import PropTypes from 'prop-types'
...
static propTypes = {
children: PropTypes.oneOfType([
PropTypes.arrayOf(PropTypes.node),
PropTypes.node
]).isRequired
}
react render props children
render() {
return (
<div>
<LoadContent>
{
({ loading }) => <span>{loading}</span>
}
</LoadContent>
</div>
)
}
react render props children
<LoadContent url="https://yourendpoint.com">
{({ loading, error, data }) => {
if (loading) return <span>Loading...</span>;
if (error) return <span>Error loading</span>;
return (
<div>
{data.map((item) => (
<div>{item}</div>
))}
</div>
);
}}
</LoadContent>
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us