(node: ElementWithValueTracker)
| 117 | } |
| 118 | |
| 119 | export function track(node: ElementWithValueTracker) { |
| 120 | if (getTracker(node)) { |
| 121 | return; |
| 122 | } |
| 123 | |
| 124 | const valueField = isCheckable(node) ? 'checked' : 'value'; |
| 125 | // This is read from the DOM so always safe to coerce. We really shouldn't |
| 126 | // be coercing to a string at all. It's just historical. |
| 127 | // eslint-disable-next-line react-internal/safe-string-coercion |
| 128 | const initialValue = '' + (node[valueField]: any); |
| 129 | node._valueTracker = trackValueOnNode(node, valueField, initialValue); |
| 130 | } |
| 131 | |
| 132 | export function trackHydrated( |
| 133 | node: ElementWithValueTracker, |
no test coverage detected