For AI agents: the complete documentation index is available at /next/llms.txt, the full documentation bundle is available at /next/llms-full.txt, and this page is available as Markdown at /next/api/lynx-api/selector-query/selector-query-select-unique-id.md.
Lynx
  • English
  • 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.