diff --git a/packages/bridge-react/__tests__/reactBridge.spec.ts b/packages/bridge-react/__tests__/reactBridge.spec.ts index c49f7bf1e..12bd597ce 100644 --- a/packages/bridge-react/__tests__/reactBridge.spec.ts +++ b/packages/bridge-react/__tests__/reactBridge.spec.ts @@ -94,7 +94,7 @@ describe('react-bridge', () => { ).toThrow(); }); - it('throws an error when react version is higher or equal than react v18', async () => { + it('will not throws the error when react version is higher or equal than react v18', async () => { expect(() => reactBridge({ React: { @@ -104,7 +104,7 @@ describe('react-bridge', () => { ReactDOM, rootComponent, }), - ).toThrow(); + ).not.toThrow(); }); it('do not throws an error when react version is v16 or v17', async () => { diff --git a/packages/bridge-react/src/reactBridge.ts b/packages/bridge-react/src/reactBridge.ts index a77532d16..3c3649641 100644 --- a/packages/bridge-react/src/reactBridge.ts +++ b/packages/bridge-react/src/reactBridge.ts @@ -69,7 +69,7 @@ export function reactBridge(this: any, userOptions: Options) { } if (!checkReactVersion(opts.React)) { throw Error( - 'Please make sure than the react version is higher than or equal to v16 and lower than v18.', + 'Please make sure than the react version is between v16 and v18.', ); } @@ -185,7 +185,7 @@ function checkReactVersion(React: typeReact) { const majorVersionString = React.version.split('.')[0]; try { return ( - Number(majorVersionString) >= 16 && Number(majorVersionString) < 18 + Number(majorVersionString) >= 16 && Number(majorVersionString) <= 18 ); } catch (err) { return false;