deleteEffects()v4.0.528
Deletes selected effects from one or more JSX nodes.
Draft API: This API is experimental and may change.
delete-effects.tsimport {deleteEffects , typeCodemodProject , typeEffectReference } from '@remotion/codemods'; declare constproject :CodemodProject ; declare consteffect :EffectReference ; constresult = awaitdeleteEffects ({project ,effects : [effect ], });console .log (result );
Indices of later effects shift after deletion. Read effects again with getJsxNodeProps() before using old effect indices. Imports are preserved.
Options
project
An in-memory CodemodProject. The input project is not mutated.
effects
Effect references to remove. References may span files and nodes; indices refer to the input project. Duplicate references are deduplicated.
Return value
A promise resolving to an object with the following properties.
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. A null old path indicates an insertion; a null new path indicates removal. Apply these mappings to references from the input project. See node references.
Errors
Throws or rejects when the target cannot be resolved, the requested edit is unsupported, or an option is invalid. Failed edits leave the input project unchanged.
Compatibility
| Browsers | Servers | Environments | |||||||
|---|---|---|---|---|---|---|---|---|---|
Chrome | Firefox | Safari | Node.js | Bun | Serverless Functions | ||||