updateMultipleJsxNodeProps()v4.0.528
Updates props on multiple JSX nodes across project files in one operation. Node references refer to the input project; the result includes their new paths.
Draft API: This API is experimental and may change.
update-multiple-jsx-node-props.tsimport {updateMultipleJsxNodeProps , typeCodemodProject , typeJsxNodeReference } from '@remotion/codemods'; declare constproject :CodemodProject ; declare consttitle :JsxNodeReference ; declare constbackground :JsxNodeReference ; constresult =updateMultipleJsxNodeProps ({project ,changes : [ {node :title ,props : {children : 'Hello'}}, {node :background ,props : {'style.opacity': 0.5}}, ], });console .log (result .project ,result .updatedNodes );
Options
project
An in-memory CodemodProject. The input project is not mutated.
changes
A non-empty array of node edits.
node
The JsxNodeReference to edit, containing filePath and nodePath.
props?
A non-empty record of prop values, such as {from: 30, 'style.opacity': 0.5}. A value of undefined removes a prop. Only one level of nested keys is supported. Computed props, including values potentially overridden by a spread, are rejected. Supply exactly one of props or updates for each edit.
updates?
A non-empty array of structured prop updates for edits that need default values or other update metadata. This form permits explicitly replacing computed prop values. Supply this instead of props.
schema?
A Remotion InteractivitySchema for schema-specific defaults and enum variants. By default, no schema-specific behavior is applied.
videoConfig?
The composition's width, height, fps, and durationInFrames, for evaluating supported expressions. By default, those runtime values are unknown.
prettierConfigOverride?
Formatting options for inserted or changed source. By default, formatting is inferred from the source.
If any edit fails, no updated project is returned and the input project remains unchanged.
Return value
project
The updated project. Unchanged files and extra project fields are preserved.
changes
An array of {filePath, previousContents, nextContents} file changes. A null content value indicates a created or deleted file.
nodePathRemappings
An array of {filePath, oldNodePath, newNodePath} mappings. See node references.
updatedNodes
Updated node references in the same order as the requested edits.
results
Per-node edit details in the same order as the requested edits: oldValueStrings, logLine, removedProps, and newNodePath. See updateJsxNodeProps().
formatted
true when the operation succeeds.
Compatibility
| Browsers | Servers | Environments | |||||||
|---|---|---|---|---|---|---|---|---|---|
Chrome | Firefox | Safari | Node.js | Bun | Serverless Functions | ||||