What happens when LWC targets config in both desktop and mobile?

530    Asked by dipesh_9001 in Salesforce , Asked on Feb 28, 2023

 I have created a Lightning Component & i want to expose the same in both Desktop & mobile. I used the following in the meta.xml file,the component is either visible in desktop or mobile.. but i need to achieve both - any help regarding this is much appreciated.

  
    lightning__AppPage
    lightning__RecordPage
    lightning__HomePage


    
        
            
        
    

The problem I'm facing is I'm not able to add another targetConfig for "lightning__RecordPage" nor am i able to add supportedFormFactor type="Large" in the existing targetConfig for "lightning__RecordPage".
Answered by Claudine Tippins
  You can do the LWC targets config in both desktop and mobile by adding another  in :-



    42.0

    true

    Best Component Ever

    This is a demo component.

   

        lightning__RecordPage

        lightning__AppPage

        lightning__HomePage

   

   

       

           

           

               

               

           

       

   


Also, If you don’t define , the component supports the form factors that the page type supports. If your lightning page supports both mobile and desktop form factor, It will apply for the component exist on the page.

App and record pages support the Large and Small form factors. Home pages support only the Large form factor.


Your Answer

Interviews

Parent Categories