Skip to content
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

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

NSeydoux
Copy link
Contributor

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.

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();
Copy link
Contributor Author

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);
Copy link
Contributor Author

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"));
Copy link
Contributor Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants