Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork13
Open
Description
At thisPR@davesnx commented the nested_context test, which is a test to ensure we don't make mistake when using the same react context nested:
let context=React.createContextReact.nullinletprovider~value~children=React.Upper_case_component ("provider",fun() ->React.Client_component { import_module="./provider.js"; import_name="Provider"; props= [ ("value",React.Element value); ("children",React.Element children) ]; client=React.Context.provider context~value~children(); } )inlet client=React.Upper_case_component ("client",fun() ->let context=React.useContext contextin context )inletconsumer()=React.Client_component { import_module="./consumer.js"; import_name="Consumer"; props=[]; client }inletcontent()=React.Upper_case_component ("content",fun() -> provider~value:React.null~children:(React.string"Hey you"))inletme()=React.Upper_case_component ("me",fun() -> provider~value:(content())~children:(React.array [|React.string"/me"; consumer() |]))inletabout()=React.Upper_case_component ("about",fun() -> provider~value:(me())~children:(React.array [|React.string"/about"; consumer() |]))inletapp()=React.Upper_case_component ("root",fun() -> provider~value:(about())~children:(React.array [|React.string"/root"; consumer() |]))
- Current shell result:
"/root<script data-payload='0:[\"$\",\"$12\",null,{\"value\":\"$f\",\"children\":\"$11\"},null,[],{}]\n'>window.srr_stream.push()</script>- What it should be:
"/root<!-- -->/about<!-- -->/me<!-- -->Hey you<script \ data-payload='0:[\"$\",\"$a\",null,{\"value\":\"$1\",\"children\":[\"/root\",[\"$\",\"$9\",null,{}]]}]\n\ '>window.srr_stream.push()</script>"In a previous attempt to solve this issue I made theclient property ofReact.Client_component as a function to lazy call it on runtime avoiding any issues with context value scope.
I'm looking for a way to solve it without getting back to client as function, but I'm opening this issue to register the bug.