Skip to content

Commit

Permalink
fix: address issues with release of react 19 (#898)
Browse files Browse the repository at this point in the history
React 19 removes the global JSX namespace - replace with React.JSX which works with both React 19
and 18. Additionally address type error with new versions of react-router-dom's `navigate` function
returning a promise.

Fixes #895
Fixes #896
  • Loading branch information
cogwirrel authored Dec 19, 2024
1 parent d4b01f7 commit 6c662d4
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ const App: React.FC = () => {
splitPanelSize: undefined,
splitPanelPreferences: undefined,
});
navigate(e.detail.href);
void navigate(e.detail.href);
}
},
[navigate],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import { useNavigate } from "react-router-dom";
const Home: React.FC = () => {
{{#hasApis}}
const navigate = useNavigate();
useEffect(() => navigate("/apiExplorer"), []);
useEffect(() => void navigate("/apiExplorer"), []);
{{/hasApis}}

{{#typeSafeApis.0}}
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ export const <%- service.className %>ClientProvider = ({
context = <%- service.className %>DefaultContext,
<%_ } _%>
children,
}: <%- service.className %>ClientProviderProps): JSX.Element => {
}: <%- service.className %>ClientProviderProps): React.JSX.Element => {
return (
<QueryClientProvider client={client}<% if (!metadata.queryV5) { %> context={context}<% } %>>
<<%- service.className %>ClientContext.Provider value={apiClient}>
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 6c662d4

Please sign in to comment.