As you can see, we are first checking if there is a post defined and, if not, returning a placeholder so we do not create an error in the app and give a hint to the editor as to what is needed. We are importing the
react-instagram-embed package and using the component to render the post with the supplied options. Note that these options have been modified from the package's defaults to better work with Scrivito.
Finally, to have Scrivito use the
InstagramWidgetComponent for rendering instances of the
InstagramWidget, we associate the widget class with the component using