juice icon indicating copy to clipboard operation
juice copied to clipboard

Doesn't seem to work

Open tincho opened this issue 6 years ago • 0 comments

Juice version: 6.0.0

My code is the output of ReactDOMServer.renderToStaticMarkup(<SomeElement />)

SomeElement is a React component using makeStyles from @material-ui/styles/makeStyles

I'm trying the following code:

    import juice from 'juice/client'

    // ...

    const allStyles = [...document.querySelectorAll('style')]
      .map(node => node.innerText)
      .join('')
    console.log(
      juice(
        `<style>${allStyles}</style>` +
          ReactDOMServer.renderToStaticMarkup(<Element />)
      )
    )

but in the output I still see all class attributes just the same as the input, and no style attribute

what am I doing wrong?

EDIT: btw copying the input into http://automattic.github.io/juice/ produces the same output, still all class attres there, no inline style

tincho avatar Mar 11 '20 17:03 tincho