Skip to content

Commit

Permalink
feat: add support for react 18
Browse files Browse the repository at this point in the history
  • Loading branch information
stepan662 committed May 30, 2022
1 parent 4feb0a1 commit 9928cac
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion packages/core/src/Observer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ export class Observer {
return;
}
if (this._observing) {
throw new Error('Tolgee: Observer is already running');
return;
}
this._observing = true;
this.observer.observe(this.properties.config.targetElement, {
Expand Down
7 changes: 4 additions & 3 deletions packages/react/src/TolgeeProvider.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
/* eslint-disable @typescript-eslint/no-var-requires */
import React, {
FunctionComponent,
PropsWithChildren,
ReactNode,
useEffect,
useState,
Expand All @@ -12,9 +13,9 @@ export const TolgeeProviderContext =
React.createContext<ContextValueType>(null);
type TolgeeProviderProps = TolgeeConfig & { loadingFallback?: ReactNode };

export const TolgeeProvider: FunctionComponent<TolgeeProviderProps> = (
props
) => {
export const TolgeeProvider: FunctionComponent<
PropsWithChildren<TolgeeProviderProps>
> = (props) => {
const config = { ...props };
delete config.children;
delete config.loadingFallback;
Expand Down

0 comments on commit 9928cac

Please sign in to comment.