Good afternoon,
I have a loading component that uses a default props.
class Loading extends Component {
render() {
const loadingClasses = classNames({
'loading': this.props.loading,
})
return (
<div className={loadingClasses}>
{this.props.loading === 'loading-inline' && <i className='fa fa-spinner fa-spin mr2' />}
<FormattedMessage id='loading' />
</div>
)
}
}
Loading.propTypes = {
loading: PropTypes.string,
}
Loading.defaultProps = {
loading: 'loading'
}
I want to use this component elsewhere, and change the value of this props. So I used it as follows:
<Loading loading='loading-inline' />
Only the component is rendered in the same way, without changing the default value.
How do I change the value?
Thank you for your attention.