Skip to content

Commit

Permalink
Renaming id -> elementId
Browse files Browse the repository at this point in the history
  • Loading branch information
mattgperry committed Nov 10, 2022
1 parent a42ccdb commit 6a0e4f6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ export function createProjectionNode<I>({
* rendered components will be committed by React). In `didUpdate`, we search the DOM for
* these potential nodes with this id and hydrate the projetion node of the ones that were commited.
*/
id: number | undefined
elementId: number | undefined

/**
* A reference to the platform-native node (currently this will be a HTMLElement).
Expand Down Expand Up @@ -293,19 +293,19 @@ export function createProjectionNode<I>({
preserveOpacity?: boolean

constructor(
id: number | undefined,
elementId: number | undefined,
latestValues: ResolvedValues = {},
parent: IProjectionNode | undefined = defaultParent?.()
) {
this.id = id
this.elementId = elementId
this.latestValues = latestValues
this.root = parent ? parent.root || parent : this
this.path = parent ? [...parent.path, parent] : []
this.parent = parent

this.depth = parent ? parent.depth + 1 : 0

id && this.root.registerPotentialNode(id, this)
elementId && this.root.registerPotentialNode(elementId, this)

for (let i = 0; i < this.path.length; i++) {
this.path[i].shouldResetTransform = true
Expand Down Expand Up @@ -355,7 +355,7 @@ export function createProjectionNode<I>({

this.root.nodes!.add(this)
this.parent?.children.add(this)
this.id && this.root.potentialNodes.delete(this.id)
this.elementId && this.root.potentialNodes.delete(this.elementId)

if (isLayoutDirty && (layout || layoutId)) {
this.isLayoutDirty = true
Expand Down
2 changes: 1 addition & 1 deletion packages/framer-motion/src/projection/node/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export type LayoutEvents =
| "animationComplete"

export interface IProjectionNode<I = unknown> {
id: number | undefined
elementId: number | undefined
parent?: IProjectionNode
relativeParent?: IProjectionNode
root?: IProjectionNode
Expand Down

0 comments on commit 6a0e4f6

Please sign in to comment.