SelectorQuery: selectUniqueID() method

Select nodes by specifying uid. It is usually used to select the corresponding node of the event target.

uid is a node's unique id. Each node has a dynamically assigned unique uid. uid can be obtained through the triggered event.

Syntax

selectUniqueID(uniqueId: string | number): NodesRef;

Parameters

uniqueId

The uid of the node to be selected.

Return Value

A NodesRef object instance representing this query result.

Examples

Add a background color to the target node of the tap event:

const onTap = useCallback((event: ReactLynx.ITouchEvent) => {
  lynx
    .createSelectorQuery()
    .selectUniqueID(event.target.uid)
    .setNativeProps({
      'background-color': 'red',
    })
    .exec();
}, []);

Compatibility

LCD tables only load in the browser

Except as otherwise noted, this work is licensed under a Creative Commons Attribution 4.0 International License, and code samples are licensed under the Apache License 2.0.