Right now there is not an easy way to change CSS in response to a change to the preview mode in the visual builder. So for example, if there is an item that changes size depending on whether it is phone, tablet, or desktop, this can't be changed responsively in the visual builder. While the JSX file can access the DOM upon initial render to get the preview container width, it is cumbersome to set-up for a re-render upon the designer changing the preview device. Making either responsiveWidth or previewMode available would allow for this to be easily accomplished with conditional logic.
Problem Description
Right now there is not an easy way to change CSS in response to a change to the preview mode in the visual builder. So for example, if there is an item that changes size depending on whether it is phone, tablet, or desktop, this can't be changed responsively in the visual builder. While the JSX file can access the DOM upon initial render to get the preview container width, it is cumbersome to set-up for a re-render upon the designer changing the preview device. Making either responsiveWidth or previewMode available would allow for this to be easily accomplished with conditional logic.