I'm trying to render a new component after some delay. My approach was this
if (success) {
return
<span className="small_font white_color border padding_5px horiz_center"
style={{ marginTop: '-5px' }}>Amount changed</span>
setTimeout(<Retransfer reqUserId={reqUserId} changeAccountLevel={changeAccountLevel} />, 2000);
} else {
return addFriend;
}
So inside a if statement i'm trying to display
<span className="small_font white_color border padding_5px horiz_center"
style={{marginTop: '-5px'}}>Amount changed</span>
part first and after some delay dispay
<Retransfer reqUserId={reqUserId} changeAccountLevel={changeAccountLevel}/>
this component. But my approach does not seem to work.
Can anyone help me with this?