How to preload image in a React JS component?
问题 I'm currently rendering a child component when a signInError occurs. The signInError is stored in the parent component and if it's not null, it renders the <SignInError/> component, as per the code below: ParentComponent.js // Some code... render() { return( <div> <SignInForm doSignIn={this.doSignIn} resetSignInError={this.resetSignInError} signInError={this.state.signInError} /> {this.state.signInError && <SignInError/>} </div> ); } So far, so good, here's the child component SignInError.js