-
Notifications
You must be signed in to change notification settings - Fork 44
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix browser demo error management #3842
base: main
Are you sure you want to change the base?
Conversation
Fixes #3841. The browser demo no longer passes an incorrect argument (from a TS perspective) to the `handleIncomingRedirect` function. This also fixes how the React app root is created with respect to the latest upgrade.
@@ -73,53 +73,45 @@ export default function App() { | |||
}); | |||
}; | |||
|
|||
const handleLogout = (e) => { | |||
e.preventDefault(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using type="button"
on the button
tag, the default "submit" behavior (causing a page refresh) is diabled.
// The default behaviour of the button is to resubmit. | ||
// This prevents the page from reloading. | ||
e.preventDefault(); | ||
events().on(EVENTS.ERROR, errorHandle); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is how error events should be handled on the session.
import App from "./App"; | ||
|
||
ReactDOM.render(<App />, document.getElementById("container")); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This approach was deprecated from React in a previous version.
Fixes #3841.
The browser demo no longer passes an incorrect argument (from a TS perspective) to the
handleIncomingRedirect
function. This also fixes how the React app root is created with respect to the latest upgrade.