Skip to content

Commit b1a2516

Browse files
authored
Update parameter name in starlette.py (#1031)
Looks like the configure() method has an error in the component parameter. In the code documentation, the parameter indicates 'component' but the name is 'constructor', I've reviewed other files, and looks like the standard is 'component'.
1 parent 2962ed9 commit b1a2516

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/py/reactpy/reactpy/backend/starlette.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636

3737
def configure(
3838
app: Starlette,
39-
constructor: RootComponentConstructor,
39+
component: RootComponentConstructor,
4040
options: Options | None = None,
4141
) -> None:
4242
"""Configure the necessary ReactPy routes on the given app.
@@ -49,7 +49,7 @@ def configure(
4949
options = options or Options()
5050

5151
# this route should take priority so set up it up first
52-
_setup_single_view_dispatcher_route(options, app, constructor)
52+
_setup_single_view_dispatcher_route(options, app, component)
5353

5454
_setup_common_routes(options, app)
5555

@@ -129,7 +129,7 @@ async def serve_index(request: Request) -> HTMLResponse:
129129

130130

131131
def _setup_single_view_dispatcher_route(
132-
options: Options, app: Starlette, constructor: RootComponentConstructor
132+
options: Options, app: Starlette, component: RootComponentConstructor
133133
) -> None:
134134
@app.websocket_route(str(STREAM_PATH))
135135
@app.websocket_route(f"{STREAM_PATH}/{{path:path}}")
@@ -145,7 +145,7 @@ async def model_stream(socket: WebSocket) -> None:
145145
await serve_layout(
146146
Layout(
147147
ConnectionContext(
148-
constructor(),
148+
component(),
149149
value=Connection(
150150
scope=socket.scope,
151151
location=Location(pathname, f"?{search}" if search else ""),

0 commit comments

Comments
 (0)