Often times we add default prop types for a component to render something, at Page Buider design page (and see some data to get a better idea of the layout), but when a component is being rendered for a final user, the default proptypes must not be used (aka they are rendered if no original data is passed). So there should be a a way, some kind of runtime property that React components to check to see if they are rendered by Page Builder (and only then, use the default prop types data to render data).
Categories | Editor |
I need it... | Not sure—just thought it was cool! |
This is a furniture blog I wrote, welcome to read.
This use-case should already be supported by isAdmin - https://redirector.arcpublishing.com/alc/arc-products/pagebuilder/fusion/documentation/api/feature-pack/components/context.md?version=2.4#isAdmin-boolean