ladle icon indicating copy to clipboard operation
ladle copied to clipboard

Single story hoisting

Open nihgwu opened this issue 3 years ago • 2 comments

Just tried out Ladle, that what I wanted to build years ago because SB is too slow and the bundle size is too big

Single story hoisting is the one I missed most

another one is how to inject preview header? I use it to inject google fonts, it would be nice that we can customise the layout

nihgwu avatar Mar 25 '22 00:03 nihgwu

Single story hoisting is the one I missed most

This seems pretty arbitrary, why not just to update the default title?

another one is how to inject preview header?

You should be able to do that through .ladle/components.tsx: https://www.ladle.dev/docs/providers

You can add there useEffect to inject additional tags into the head or use library like react-helmet.

tajo avatar Mar 25 '22 19:03 tajo

image I would love to have the default story be hoisted, yes I managed to make them hoisted by changing the title to components and set storyName as component name

You can add there useEffect to inject additional tags into the head or use library like react-helmet.

yes I can change anything programatically but it would be nice config it directly, for example the document title, if we use react-helmet I still need to read the global state for current story name so I can set it to Button - Components | MySite, but it would be super simple if we can config the default website title

nihgwu avatar Mar 25 '22 21:03 nihgwu