Skip to content
Merged
Show file tree
Hide file tree
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 @@ -55,11 +55,11 @@ export default function ScrollIntoViewCase() {
const scrollContainerRef = useRef(null);

const scrollVertical = () => {
fragmentRef.current.experimental_scrollIntoView(alignToTop);
fragmentRef.current.scrollIntoView(alignToTop);
};

const scrollVerticalNoChildren = () => {
noChildRef.current.experimental_scrollIntoView(alignToTop);
noChildRef.current.scrollIntoView(alignToTop);
};

useEffect(() => {
Expand Down
2 changes: 1 addition & 1 deletion fixtures/view-transition/src/components/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import React, {
useLayoutEffect,
useEffect,
useState,
unstable_addTransitionType as addTransitionType,
addTransitionType,
} from 'react';

import Chrome from './Chrome.js';
Expand Down
4 changes: 2 additions & 2 deletions fixtures/view-transition/src/components/Page.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React, {
unstable_addTransitionType as addTransitionType,
unstable_ViewTransition as ViewTransition,
addTransitionType,
ViewTransition,
Activity,
useLayoutEffect,
useEffect,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,8 @@ describe('Store component filters', () => {
});

it('should filter ViewTransition', async () => {
const ViewTransition = React.unstable_ViewTransition;
const ViewTransition =
React.ViewTransition || React.unstable_ViewTransition;

if (ViewTransition != null) {
await actAsync(async () =>
Expand Down
4 changes: 2 additions & 2 deletions packages/react-dom-bindings/src/client/ReactFiberConfigDOM.js
Original file line number Diff line number Diff line change
Expand Up @@ -3341,13 +3341,13 @@ function validateDocumentPositionWithFiberTree(

if (enableFragmentRefsScrollIntoView) {
// $FlowFixMe[prop-missing]
FragmentInstance.prototype.experimental_scrollIntoView = function (
FragmentInstance.prototype.scrollIntoView = function (
this: FragmentInstanceType,
alignToTop?: boolean,
): void {
if (typeof alignToTop === 'object') {
throw new Error(
'FragmentInstance.experimental_scrollIntoView() does not support ' +
'FragmentInstance.scrollIntoView() does not support ' +
'scrollIntoViewOptions. Use the alignToTop boolean instead.',
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ describe('ReactDOMFizzViewTransition', () => {
Stream = require('stream');

Suspense = React.Suspense;
ViewTransition = React.unstable_ViewTransition;
ViewTransition = React.ViewTransition;

// Test Environment
const jsdom = new JSDOM(
Expand Down
24 changes: 12 additions & 12 deletions packages/react-dom/src/__tests__/ReactDOMFragmentRefs-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -1960,9 +1960,9 @@ describe('FragmentRefs', () => {
});

expect(() => {
fragmentRef.current.experimental_scrollIntoView({block: 'start'});
fragmentRef.current.scrollIntoView({block: 'start'});
}).toThrowError(
'FragmentInstance.experimental_scrollIntoView() does not support ' +
'FragmentInstance.scrollIntoView() does not support ' +
'scrollIntoViewOptions. Use the alignToTop boolean instead.',
);
});
Expand Down Expand Up @@ -1996,11 +1996,11 @@ describe('FragmentRefs', () => {
});

// Default call
fragmentRef.current.experimental_scrollIntoView();
fragmentRef.current.scrollIntoView();
expectLast(logs, 'childA');
logs = [];
// alignToTop=true
fragmentRef.current.experimental_scrollIntoView(true);
fragmentRef.current.scrollIntoView(true);
expectLast(logs, 'childA');
});

Expand All @@ -2027,7 +2027,7 @@ describe('FragmentRefs', () => {
logs.push('childB');
});

fragmentRef.current.experimental_scrollIntoView(false);
fragmentRef.current.scrollIntoView(false);
expectLast(logs, 'childB');
});

Expand Down Expand Up @@ -2068,7 +2068,7 @@ describe('FragmentRefs', () => {
});

// Default call
fragmentRef.current.experimental_scrollIntoView();
fragmentRef.current.scrollIntoView();
expectLast(logs, 'childA');
});

Expand Down Expand Up @@ -2157,7 +2157,7 @@ describe('FragmentRefs', () => {
});

// Default call
fragmentRef.current.experimental_scrollIntoView();
fragmentRef.current.scrollIntoView();
expectLast(logs, 'header');

childARef.current.scrollIntoView.mockClear();
Expand All @@ -2167,7 +2167,7 @@ describe('FragmentRefs', () => {
logs = [];

// // alignToTop=false
fragmentRef.current.experimental_scrollIntoView(false);
fragmentRef.current.scrollIntoView(false);
expectLast(logs, 'C');
});
});
Expand Down Expand Up @@ -2195,14 +2195,14 @@ describe('FragmentRefs', () => {
siblingBRef.current.scrollIntoView = jest.fn();

// Default call
fragmentRef.current.experimental_scrollIntoView();
fragmentRef.current.scrollIntoView();
expect(siblingARef.current.scrollIntoView).toHaveBeenCalledTimes(0);
expect(siblingBRef.current.scrollIntoView).toHaveBeenCalledTimes(1);

siblingBRef.current.scrollIntoView.mockClear();

// alignToTop=true
fragmentRef.current.experimental_scrollIntoView(true);
fragmentRef.current.scrollIntoView(true);
expect(siblingARef.current.scrollIntoView).toHaveBeenCalledTimes(0);
expect(siblingBRef.current.scrollIntoView).toHaveBeenCalledTimes(1);
});
Expand Down Expand Up @@ -2239,7 +2239,7 @@ describe('FragmentRefs', () => {
siblingBRef.current.scrollIntoView = jest.fn();

// alignToTop=false
fragmentRef.current.experimental_scrollIntoView(false);
fragmentRef.current.scrollIntoView(false);
expect(siblingARef.current.scrollIntoView).toHaveBeenCalledTimes(1);
expect(siblingBRef.current.scrollIntoView).toHaveBeenCalledTimes(0);
});
Expand All @@ -2260,7 +2260,7 @@ describe('FragmentRefs', () => {
});

parentRef.current.scrollIntoView = jest.fn();
fragmentRef.current.experimental_scrollIntoView();
fragmentRef.current.scrollIntoView();
expect(parentRef.current.scrollIntoView).toHaveBeenCalledTimes(1);
});
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ describe('ReactFragment', () => {
React = require('react');
Suspense = React.Suspense;
Activity = React.Activity;
ViewTransition = React.unstable_ViewTransition;
ViewTransition = React.ViewTransition;
ReactNoop = require('react-noop-renderer');
const InternalTestUtils = require('internal-test-utils');
waitForAll = InternalTestUtils.waitForAll;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -941,7 +941,7 @@ describe('ReactLazy', () => {

// @gate enableViewTransition
it('throws with a useful error when wrapping ViewTransition with lazy()', async () => {
const BadLazy = lazy(() => fakeImport(React.unstable_ViewTransition));
const BadLazy = lazy(() => fakeImport(React.ViewTransition));

const root = ReactTestRenderer.create(
<Suspense fallback={<Text text="Loading..." />}>
Expand All @@ -954,7 +954,7 @@ describe('ReactLazy', () => {

await waitForAll(['Loading...']);

await resolveFakeImport(React.unstable_ViewTransition);
await resolveFakeImport(React.ViewTransition);
root.update(
<Suspense fallback={<Text text="Loading..." />}>
<BadLazy />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ describe('ViewTransitionReactServer', () => {
jest.resetModules();
jest.mock('react', () => require('react/react.react-server'));
ReactServer = require('react');
ViewTransition = ReactServer.unstable_ViewTransition;
ViewTransition = ReactServer.ViewTransition;
ReactNoopFlightServer = require('react-noop-renderer/flight-server');

jest.resetModules();
Expand Down
2 changes: 2 additions & 0 deletions packages/react/index.development.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ export {
startTransition,
unstable_LegacyHidden,
Activity,
ViewTransition,
addTransitionType,
unstable_Scope,
unstable_SuspenseList,
unstable_TracingMarker,
Expand Down
4 changes: 2 additions & 2 deletions packages/react/index.experimental.development.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@ export {
unstable_postpone,
unstable_getCacheForType,
unstable_SuspenseList,
unstable_ViewTransition,
ViewTransition,
unstable_startGestureTransition,
unstable_addTransitionType,
addTransitionType,
unstable_useCacheRefresh,
useId,
useCallback,
Expand Down
4 changes: 2 additions & 2 deletions packages/react/index.experimental.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@ export {
unstable_postpone,
unstable_getCacheForType,
unstable_SuspenseList,
unstable_ViewTransition,
ViewTransition,
unstable_startGestureTransition,
unstable_addTransitionType,
addTransitionType,
unstable_useCacheRefresh,
useId,
useCallback,
Expand Down
6 changes: 4 additions & 2 deletions packages/react/index.fb.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,11 @@ export {
unstable_LegacyHidden,
unstable_Scope,
unstable_SuspenseList,
unstable_ViewTransition,
ViewTransition,
ViewTransition as unstable_ViewTransition,
unstable_TracingMarker,
unstable_addTransitionType,
addTransitionType,
addTransitionType as unstable_addTransitionType,
unstable_useCacheRefresh,
use,
useActionState,
Expand Down
4 changes: 2 additions & 2 deletions packages/react/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@ export {
unstable_Scope,
unstable_SuspenseList,
unstable_TracingMarker,
unstable_ViewTransition,
unstable_addTransitionType,
ViewTransition,
addTransitionType,
unstable_getCacheForType,
unstable_useCacheRefresh,
useId,
Expand Down
2 changes: 2 additions & 0 deletions packages/react/index.stable.development.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ export {
PureComponent,
StrictMode,
Suspense,
ViewTransition,
addTransitionType,
cloneElement,
createContext,
createElement,
Expand Down
2 changes: 2 additions & 0 deletions packages/react/index.stable.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ export {
PureComponent,
StrictMode,
Suspense,
ViewTransition,
addTransitionType,
cloneElement,
createContext,
createElement,
Expand Down
4 changes: 2 additions & 2 deletions packages/react/src/ReactClient.js
Original file line number Diff line number Diff line change
Expand Up @@ -125,8 +125,8 @@ export {
// enableTransitionTracing
REACT_TRACING_MARKER_TYPE as unstable_TracingMarker,
// enableViewTransition
REACT_VIEW_TRANSITION_TYPE as unstable_ViewTransition,
addTransitionType as unstable_addTransitionType,
REACT_VIEW_TRANSITION_TYPE as ViewTransition,
addTransitionType as addTransitionType,
// enableGestureTransition
startGestureTransition as unstable_startGestureTransition,
// DEV-only
Expand Down
2 changes: 1 addition & 1 deletion packages/react/src/ReactServer.experimental.development.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ export {
REACT_PROFILER_TYPE as Profiler,
REACT_STRICT_MODE_TYPE as StrictMode,
REACT_SUSPENSE_TYPE as Suspense,
REACT_VIEW_TRANSITION_TYPE as ViewTransition,
cloneElement,
createElement,
createRef,
Expand All @@ -83,6 +84,5 @@ export {
version,
// Experimental
REACT_SUSPENSE_LIST_TYPE as unstable_SuspenseList,
REACT_VIEW_TRANSITION_TYPE as unstable_ViewTransition,
captureOwnerStack, // DEV-only
};
2 changes: 1 addition & 1 deletion packages/react/src/ReactServer.experimental.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ export {
REACT_PROFILER_TYPE as Profiler,
REACT_STRICT_MODE_TYPE as StrictMode,
REACT_SUSPENSE_TYPE as Suspense,
REACT_VIEW_TRANSITION_TYPE as ViewTransition,
cloneElement,
createElement,
createRef,
Expand All @@ -82,5 +83,4 @@ export {
version,
// Experimental
REACT_SUSPENSE_LIST_TYPE as unstable_SuspenseList,
REACT_VIEW_TRANSITION_TYPE as unstable_ViewTransition,
};
3 changes: 2 additions & 1 deletion packages/react/src/ReactServer.fb.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@ export {
REACT_PROFILER_TYPE as Profiler,
REACT_STRICT_MODE_TYPE as StrictMode,
REACT_SUSPENSE_TYPE as Suspense,
REACT_VIEW_TRANSITION_TYPE as ViewTransition,
REACT_VIEW_TRANSITION_TYPE as unstable_ViewTransition,
cloneElement,
createElement,
createRef,
Expand All @@ -71,5 +73,4 @@ export {
captureOwnerStack, // DEV-only
// Experimental
REACT_SUSPENSE_LIST_TYPE as unstable_SuspenseList,
REACT_VIEW_TRANSITION_TYPE as unstable_ViewTransition,
};
2 changes: 2 additions & 0 deletions packages/react/src/ReactServer.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import {
REACT_PROFILER_TYPE,
REACT_STRICT_MODE_TYPE,
REACT_SUSPENSE_TYPE,
REACT_VIEW_TRANSITION_TYPE,
} from 'shared/ReactSymbols';
import {
cloneElement,
Expand Down Expand Up @@ -46,6 +47,7 @@ export {
REACT_PROFILER_TYPE as Profiler,
REACT_STRICT_MODE_TYPE as StrictMode,
REACT_SUSPENSE_TYPE as Suspense,
REACT_VIEW_TRANSITION_TYPE as ViewTransition,
cloneElement,
createElement,
createRef,
Expand Down
6 changes: 3 additions & 3 deletions packages/shared/ReactFeatureFlags.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ export const enablePostpone = __EXPERIMENTAL__;

export const enableHalt: boolean = true;

export const enableViewTransition = __EXPERIMENTAL__;
export const enableViewTransition: boolean = true;

export const enableGestureTransition = __EXPERIMENTAL__;

Expand Down Expand Up @@ -145,8 +145,8 @@ export const transitionLaneExpirationMs = 5000;
*/
export const enableInfiniteRenderLoopDetection: boolean = false;

export const enableFragmentRefs = __EXPERIMENTAL__;
export const enableFragmentRefsScrollIntoView = __EXPERIMENTAL__;
export const enableFragmentRefs: boolean = true;
export const enableFragmentRefsScrollIntoView: boolean = true;

// -----------------------------------------------------------------------------
// Ready for next major.
Expand Down
4 changes: 2 additions & 2 deletions packages/shared/forks/ReactFeatureFlags.native-oss.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ export const enableHydrationLaneScheduling: boolean = true;
export const enableYieldingBeforePassive: boolean = false;

export const enableThrottledScheduling: boolean = false;
export const enableViewTransition: boolean = false;
export const enableViewTransition: boolean = true;
export const enableGestureTransition: boolean = false;
export const enableScrollEndPolyfill: boolean = true;
export const enableSuspenseyImages: boolean = false;
Expand All @@ -72,7 +72,7 @@ export const enableHydrationChangeEvent: boolean = false;
export const enableDefaultTransitionIndicator: boolean = false;
export const ownerStackLimit = 1e4;

export const enableFragmentRefs: boolean = false;
export const enableFragmentRefs: boolean = true;
export const enableFragmentRefsScrollIntoView: boolean = false;

// Profiling Only
Expand Down
4 changes: 2 additions & 2 deletions packages/shared/forks/ReactFeatureFlags.test-renderer.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,8 @@ export const enableHydrationChangeEvent: boolean = false;
export const enableDefaultTransitionIndicator: boolean = false;
export const ownerStackLimit = 1e4;

export const enableFragmentRefs: boolean = false;
export const enableFragmentRefsScrollIntoView: boolean = false;
export const enableFragmentRefs: boolean = true;
export const enableFragmentRefsScrollIntoView: boolean = true;

// TODO: This must be in sync with the main ReactFeatureFlags file because
// the Test Renderer's value must be the same as the one used by the
Expand Down
Loading
Loading