Skip to content

Commit

Permalink
Merge branch 'main' into @tomekzaw/react-native-0.77
Browse files Browse the repository at this point in the history
  • Loading branch information
tomekzaw committed Jan 10, 2025
2 parents 8375134 + 6035538 commit 214d0d3
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -144,14 +144,23 @@ export function createAnimatedComponent(
if (IS_JEST) {
this.jestAnimatedStyle = { value: {} };
}

const entering = this.props.entering;
if (entering && isFabric()) {
updateLayoutAnimations(
this.reanimatedID,
LayoutAnimationType.ENTERING,
maybeBuild(entering, this.props?.style, AnimatedComponent.displayName)
);
const skipEntering = this.context?.current;
if (
!entering ||
getReducedMotionFromConfig(entering as CustomConfig) ||
skipEntering ||
!isFabric()
) {
return;
}
// This call is responsible for configuring entering animations on Fabric.
updateLayoutAnimations(
this.reanimatedID,
LayoutAnimationType.ENTERING,
maybeBuild(entering, this.props?.style, AnimatedComponent.displayName)
);
}

componentDidMount() {
Expand Down Expand Up @@ -440,17 +449,18 @@ export function createAnimatedComponent(
return;
}

const layout = this.props.layout
? maybeBuild(
this.props.layout,
undefined /* We don't have to warn user if style has common properties with animation for LAYOUT */,
AnimatedComponent.displayName
)
: undefined;
const layout = this.props.layout;
if (!layout || getReducedMotionFromConfig(layout as CustomConfig)) {
return;
}
updateLayoutAnimations(
this.getComponentViewTag(),
LayoutAnimationType.LAYOUT,
layout
maybeBuild(
layout,
undefined /* We don't have to warn user if style has common properties with animation for LAYOUT */,
AnimatedComponent.displayName
)
);
}

Expand Down Expand Up @@ -536,7 +546,7 @@ export function createAnimatedComponent(
}

const skipEntering = this.context?.current;
if (entering && !skipEntering && !IS_WEB) {
if (entering && !isFabric() && !skipEntering && !IS_WEB) {
updateLayoutAnimations(
tag,
LayoutAnimationType.ENTERING,
Expand Down
6 changes: 3 additions & 3 deletions packages/react-native-reanimated/src/logger/logger.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ export function registerLoggerConfig(config: LoggerConfigInternal) {
*/
export function replaceLoggerImplementation(logFunction: LogFunction) {
'worklet';
registerLoggerConfig({ ...__reanimatedLoggerConfig, logFunction });
registerLoggerConfig({ ...global.__reanimatedLoggerConfig, logFunction });
}

/**
Expand All @@ -108,7 +108,7 @@ export function replaceLoggerImplementation(logFunction: LogFunction) {
export function updateLoggerConfig(options?: Partial<LoggerConfig>) {
'worklet';
registerLoggerConfig({
...__reanimatedLoggerConfig,
...global.__reanimatedLoggerConfig,
// Don't reuse previous level and strict values from the global config
level: options?.level ?? DEFAULT_LOGGER_CONFIG.level,
strict: options?.strict ?? DEFAULT_LOGGER_CONFIG.strict,
Expand All @@ -125,7 +125,7 @@ function handleLog(
options: LogOptions
) {
'worklet';
const config = __reanimatedLoggerConfig;
const config = global.__reanimatedLoggerConfig;
if (
// Don't log if the log is marked as strict-only and the config doesn't
// enable strict logging
Expand Down

0 comments on commit 214d0d3

Please sign in to comment.