React-styleguidist: Render preview in Iframe

Created on 11 Apr 2017  路  6Comments  路  Source: styleguidist/react-styleguidist

For some components we need to render component in iframe to demostrate responsibility, body styles loader. For example, page component or maybe footer/header.
For this case wee need to load component and it dependencies (styles and another components).
I tried to wrap your Preview with own implementation which just render to ifrme, but styles loaded in parent window context, but i need to loade it to iframe.
Could you help me please

question

All 6 comments

@kulakowka, I already tried this component, but it not allow to use any styleloader

@stepancar try to use JSS %)

@kulakowka, it's not a solution for common task, cause not all developers can switch their components to jss. As I understand , more right, and more complex solution is build preview scripts separately to static and load it in iframe

@stepancar you can create your own Preview component and use it with SG: https://github.com/styleguidist/react-styleguidist/blob/master/examples/customised/styleguide.config.js#L51

I鈥檇 try to avoid iframes ;-)

Was this page helpful?
0 / 5 - 0 ratings

Related issues

eduardoinnorway picture eduardoinnorway  路  3Comments

gscottolson picture gscottolson  路  3Comments

magicmark picture magicmark  路  3Comments

sapegin picture sapegin  路  3Comments

mealeyst picture mealeyst  路  3Comments