Use the temp variable in all the render function.
Use the react component state instead of creating a new component.