Skip to content

Commit

Permalink
Merge pull request #430 from Adyen/bugfix/AD-274
Browse files Browse the repository at this point in the history
AD-274 Browser console error Cannot read properties of null (reading …
  • Loading branch information
kpieloch authored Sep 3, 2024
2 parents 306e879 + dfc0be7 commit 32b4860
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,21 @@ import {RouterProvider} from "react-router-dom";
import {router} from "./router/router"


const root = ReactDOM.createRoot(document.getElementById('root'));
root.render(
<React.StrictMode>
<Provider store={store}>
const rootElement = document.getElementById('root');

if (rootElement) {
const root = ReactDOM.createRoot(rootElement);
root.render(
<React.StrictMode>
<Provider store={store}>
<RouterProvider router={router}/>
</Provider>
</React.StrictMode>
);
</Provider>
</React.StrictMode>
);

// If you want to start measuring performance in your app, pass a function
// to log results (for example: reportWebVitals(console.log))
// or send to an analytics endpoint. Learn more: https://bit.ly/CRA-vitals
reportWebVitals();
}

// If you want to start measuring performance in your app, pass a function
// to log results (for example: reportWebVitals(console.log))
// or send to an analytics endpoint. Learn more: https://bit.ly/CRA-vitals
reportWebVitals();
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ declare var ACC: any;
export const urlContextPath: string = ACC.config.encodedContextPath

const rootElement = document.getElementById('root');
export const CSRFToken = rootElement.getAttribute('csrf-token');
export const CSRFToken = rootElement ? rootElement.getAttribute('csrf-token') : undefined;

0 comments on commit 32b4860

Please sign in to comment.