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

chore: Throw an error when the New Architecture is not available #6913

Merged
merged 2 commits into from
Jan 21, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import type {
} from '../commonTypes';
import { checkCppVersion } from '../platform-specific/checkCppVersion';
import { jsVersion } from '../platform-specific/jsVersion';
import { isFabric } from '../PlatformChecker';
import { isFabric, isWeb } from '../PlatformChecker';
import type React from 'react';
import { getShadowNodeWrapperFromRef } from '../fabricUtils';
import { ReanimatedTurboModule } from '../specs';
Expand All @@ -25,6 +25,8 @@ import type {
NormalizedSingleCSSAnimationSettings,
} from '../css/platform/native';

const IS_WEB = isWeb();

export function createNativeReanimatedModule(): IReanimatedModule {
return new NativeReanimatedModule();
}
Expand Down Expand Up @@ -65,6 +67,11 @@ class NativeReanimatedModule implements IReanimatedModule {
See https://docs.swmansion.com/react-native-reanimated/docs/guides/troubleshooting#native-part-of-reanimated-doesnt-seem-to-be-initialized for more details.`
);
}
if (!isFabric() && !IS_WEB) {
throw new ReanimatedError(
'Reanimated 4 supports only the React Native New Architecture and web.'
);
}
if (__DEV__) {
checkCppVersion();
}
Expand Down
Loading