code: def test_rdcap002_component_as_props_dynamic_id(dash_duo):
      # Test for issue 2296
      app = Dash(__name__)
      n = 3
      app.layout = Div(
          [
              Button(
                  "add options",
                  id="add-option",
                  style={"marginBottom": "25px"},
              ),
              Checklist(
                  [opt(str(uuid.uuid4())) for i in range(n)],
                  id="options",
              ),
          ]
      )
  
      @app.callback(
          Output("options", "options"),
          Input("add-option", "n_clicks"),
          State("options", "options"),
          prevent_initial_call=True,
      )
      def add_option(_, options):
          return [*options, opt(str(uuid.uuid4()))]
  
      @app.callback(
          Output({"type": "text", "index": MATCH}, "children"),
          Input({"type": "button", "index": MATCH}, "n_clicks"),
      )
      def demo(n_clicks):
          return n_clicks
  
      dash_duo.start_server(app)
  
      dash_duo.wait_for_element("#add-option").click()
      for i in range(1, n + 2):
          dash_duo.wait_for_text_to_equal(
              f"#options label:nth-child({i}) span", ""
          )
          dash_duo.wait_for_element(
              f"#options label:nth-child({i}) button"
          ).click()
          dash_duo.wait_for_text_to_equal(
              f"#options label:nth-child({i}) span", "1"
          )
  
file_path: dash/tests/integration/renderer/test_component_as_prop.py
imports: import uuid
  from dash import Dash, Input, Output, callback_context, State, MATCH
  from dash_test_components import ComponentAsProp
  from dash.dcc import Checklist, Dropdown
  from dash.html import Button, Div, Span
label_desc: Use image node_id 3 for calling a global function with example usage: test_rdcap002_component_as_props_dynamic_id(dash_duo) and returns: list, n_clicks