You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have noticed that if I have nested components and the parent component is included with loading: 'defer', the child component can no longer read URL parameters. Here is my code:
Parent Component
<?phpnamespaceApp\Twig\Components;
useSymfony\UX\LiveComponent\Attribute\AsLiveComponent;
useSymfony\UX\LiveComponent\DefaultActionTrait;
#[AsLiveComponent]
class ParentComponent
{
use DefaultActionTrait;
}
If I now call up my page with ?sort=foo, the value “name” is dumped instead of “foo”. If I remove the { loading: 'defer' } from the parent component, the value “foo” is dumped. Is it possible in this scenario that the parent component remains defered and the child component can still read the URL parameters?
The text was updated successfully, but these errors were encountered:
So is it intentional that the children cannot use URL parameters in this case? Should then be mentioned in the documentation.
But you could solve it by checking in the QueryStringPropsExtractor at the beginning whether the current route is ux_live_component (this is the case for the children in my example). If it is, you could then extract the query string from the referer URL instead of from the current URL. Or is there something against this?
I have noticed that if I have nested components and the parent component is included with
loading: 'defer'
, the child component can no longer read URL parameters. Here is my code:Parent Component
Child Component
Main template:
If I now call up my page with ?sort=foo, the value “name” is dumped instead of “foo”. If I remove the
{ loading: 'defer' }
from the parent component, the value “foo” is dumped. Is it possible in this scenario that the parent component remains defered and the child component can still read the URL parameters?The text was updated successfully, but these errors were encountered: