MCPcopy Create free account
hub / github.com/tree-sitter/tree-sitter-javascript / update

Method update

examples/text-editor-component.js:3898–3914  ·  view source on GitHub ↗
(newProps)

Source from the content-addressed store, hash-verified

3896 }
3897
3898 update (newProps) {
3899 if (this.props.lineDecoration !== newProps.lineDecoration) {
3900 this.props.lineDecoration = newProps.lineDecoration
3901 this.element.className = this.buildClassName()
3902 }
3903
3904 if (this.props.screenRow !== newProps.screenRow) {
3905 this.props.screenRow = newProps.screenRow
3906 this.element.dataset.screenRow = newProps.screenRow
3907 }
3908
3909 if (!textDecorationsEqual(this.props.textDecorations, newProps.textDecorations)) {
3910 this.props.textDecorations = newProps.textDecorations
3911 this.element.firstChild.remove()
3912 this.appendContents()
3913 }
3914 }
3915
3916 destroy () {
3917 const {nodePool, lineComponentsByScreenLineId, screenLine} = this.props

Callers 4

setInputEnabledMethod · 0.45
updateLinesMethod · 0.45
updateMethod · 0.45

Calls 3

buildClassNameMethod · 0.95
appendContentsMethod · 0.95
textDecorationsEqualFunction · 0.85

Tested by

no test coverage detected