-
Notifications
You must be signed in to change notification settings - Fork 49.1k
[refactor] Add element type for Activity #32499
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
Changes from all commits
a7eb89f
7fc2637
7e52653
cdfb5f6
6db24d0
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -71,6 +71,7 @@ import { | |
TracingMarkerComponent, | ||
Throw, | ||
ViewTransitionComponent, | ||
ActivityComponent, | ||
} from './ReactWorkTags'; | ||
import {OffscreenVisible} from './ReactFiberActivityComponent'; | ||
import {getComponentNameFromOwner} from 'react-reconciler/src/getComponentNameFromFiber'; | ||
|
@@ -107,6 +108,7 @@ import { | |
REACT_TRACING_MARKER_TYPE, | ||
REACT_ELEMENT_TYPE, | ||
REACT_VIEW_TRANSITION_TYPE, | ||
REACT_ACTIVITY_TYPE, | ||
} from 'shared/ReactSymbols'; | ||
import {TransitionTracingMarker} from './ReactFiberTracingMarkerComponent'; | ||
import { | ||
|
@@ -588,6 +590,8 @@ export function createFiberFromTypeAndProps( | |
} | ||
} else { | ||
getTag: switch (type) { | ||
case REACT_ACTIVITY_TYPE: | ||
return createFiberFromActivity(pendingProps, mode, lanes, key); | ||
case REACT_FRAGMENT_TYPE: | ||
return createFiberFromFragment(pendingProps.children, mode, lanes, key); | ||
case REACT_STRICT_MODE_TYPE: | ||
|
@@ -865,6 +869,17 @@ export function createFiberFromOffscreen( | |
fiber.stateNode = primaryChildInstance; | ||
return fiber; | ||
} | ||
export function createFiberFromActivity( | ||
pendingProps: OffscreenProps, | ||
mode: TypeOfMode, | ||
lanes: Lanes, | ||
key: null | string, | ||
): Fiber { | ||
const fiber = createFiber(ActivityComponent, pendingProps, key, mode); | ||
fiber.elementType = REACT_ACTIVITY_TYPE; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is not actually right. This was wrong for In the case of In fact, it looks like we get this wrong for all these built-ins so wrapping them would yield the wrong reconciliation. So it's an existing bug that we need to fix separately. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is this wrong for What's the fix? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Actually, we throw for this case already with an error that says: Caution Element type is invalid. Received a promise that resolves to: ViewTransition. Lazy element type must resolve to a class or function. This is broken for portal, so I fixed it and tested all the built-ins here: #32640 |
||
fiber.lanes = lanes; | ||
return fiber; | ||
} | ||
|
||
export function createFiberFromViewTransition( | ||
pendingProps: ViewTransitionProps, | ||
|
Uh oh!
There was an error while loading. Please reload this page.