2

When we add lightning component to app builder its showing spinner because if there is nothing it keeps loading.

We wanted to show some message if its get opened in App builder in "Preview Mode" is it possible to know if Lightning component is opened in Lightning App builder then show something.

Please suggest and advise.

  • The spinner keeps loading looks like a problem in code or need better error handling. – Raul Jun 20 '19 at 14:27
4

No, there's no specific interface or event that specifies that you're in preview mode. What you need to do will depend on circumstances. For example, if you're using force:hasRecordId, you might decide to show dummy data if recordId is null. The documentation also states:

Give your required attributes default values. When a component that has required attributes with no default values is added to the App Builder, it appears invalid, which is a poor user experience.

You should provide enough default values that your component can work out a reasonable preview mode.

| improve this answer | |

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.