code: def render_fn(get_state: Callable) -> Callable:
      import justpy as jp
  
      def webpage():
          wp = jp.QuasarPage(dark=True)
          d = jp.Div(classes="q-pa-md q-gutter-sm", a=wp)
          container = jp.QBtn(color="primary", text="Counter: 0")
  
          async def click(*_):
              state = get_state()
              state.counter += 1
              container.text = f"Counter: {state.counter}"
  
          button = jp.QBtn(
              color="primary", text="Click Me!", click=click
          )
  
          d.add(button)
          d.add(container)
  
          return wp
  
      return webpage
  
file_path: pytorch-lightning/examples/app/justpy/app.py
imports: from typing import Callable
  from lightning import LightningApp, LightningFlow
  from lightning.app.frontend import JustPyFrontend
label_desc: Use image node_id 1 for calling a global function with example usage: render_fn(get_state) and returns: webpage, wp