Home > Back-end >  I want to setup two events with one click in TSX. I am struggling to figure this out. Any help would
I want to setup two events with one click in TSX. I am struggling to figure this out. Any help would

Time:12-22

{!localError ? (
            <div className="create">
                <Button
                    variant=""
                    color=""
                    disabled={title === ""}
                    onClick={transfer} {window.location.reload()}
                >
                    Create and transfer
                </Button>
            </div>
  onClick={transfer} {window.location.reload()}

I can't get the page to refresh after transferring the data.

CodePudding user response:

You can use an inline function that will call these 2 functions for example :

onClick={() => {
  transfer();
  window.location.reload();
}}
  • Related