1.Can I invoke LWC component from a URL? or should I wrap the LWC Component in an aura component and then invoke the aura component?

2.If I can invoke the LWC component directly from URL, how can I read any parameters in LWC Component that may have been passed at the time of invocation?

My requirement is simple:

I am displaying an URL- "Create New Type1 Lead" on home page which will not only invoke the "createLead" LWC component but also passes the recordTypeId for "Type1" lead.

I should be able to read the recordTypeId url parameter value inside LWC component and make decisions accordingly.


LWC is currently only supported for core platform features. This means you won't be able to use LWC in experiences like Visualforce, Flows, URL Addressable tabs, etc. Even if you wrap them in an Aura component, they simply won't work. For now, you'll need to write an Aura component. Only attempt to use LWC for supported experiences.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.