BitBoxSwiss / bitbox-wallet-app

The BitBoxApp for desktop and mobile.
https://bitbox.swiss/app
Apache License 2.0
251 stars 82 forks source link

frontend: remove unsafe componnetwillmount fix esc in webdev #2719

Closed thisconnect closed 3 months ago

thisconnect commented 3 months ago

When Strict Mode is on, React will also run one extra setup+cleanup cycle in development. This helps reveal subtle bugs that are hard to catch manually. This also makes the deprecated UNSAFE componentWillMount only run first time.

Send view used UNSAFE_componentWillMount to listen to keydown events that handles ESC button. In webdev pressing ESC button did therefore not go back to the account overview.

Changed to register events on componentDidMount.

Also changed deprecated KeyBoardEvent.keyCode to KeyBoardEvent.key.

See: