How to use the fela-utils.getRehydrationIndex function in fela-utils

To help you get started, we’ve selected a few fela-utils examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github robinweser / fela / packages / fela-bindings / src / renderToComponentFactory.js View on Github external
return function renderToComponent(renderer: DOMRenderer): any {
    const cacheCluster = clusterCache(renderer.cache, renderer.mediaQueryOrder)
    const rehydrationIndex = getRehydrationIndex(renderer)

    const componentList = reduce(
      sheetMap,
      (list, type, key) => {
        if (cacheCluster[key].length > 0) {
          list.push(
            createStyleElement(cacheCluster[key], rehydrationIndex, type)
          )
        }

        return list
      },
      []
    )

    return reduce(