blockly > Block > renameVarById

Block.renameVarById() method

Notification that a variable is renaming. If the ID matches one of this block's variables, rename it.

Signature:

renameVarById(oldId: string, newId: string): void;

Parameters

Parameter Type Description
oldId string ID of variable to rename.
newId string ID of new variable. May be the same as oldId, but with an updated name.

Returns:

void