'Modal for showing application token in antd

I am creating an application in which you can create API tokens just like PAT tokens in github. I want to show them just once. For showing them I am using a Modal component. How can I trigger the modal to show token details once the api request for generating token is completed.



Solution 1:[1]

  1. You can create a state that will be initialized as null
  2. When the token was created, you can store the details of the token in the state
  3. Render the modal conditionally based on the state.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Yedidya Rashi