score:2

Accepted answer
const {useAddUser} from './mainstorage'

const SignMessageButton: FC = () => {
  const {publicKey, signMessage} = useWallet()
  const {addUser} = useAddUser();

  const onClick = React.useCallback(
    async () => {
      try {
        // ...
        addUser()
      } catch (error) {/*...*/}
    }, 
    [publicKey, signMessage, addUser]
  )

  /*...*/
}

Related Query

More Query from same tag