AntoineW/luge

@chotardlucien I just tried to import luge through a component using useEffect and I can make it work in both develop and build mode.

Closed this issue · 2 comments

@AntoineW

I created a luge.js component like this:

import { useEffect } from "react"

const LugeReact = () => {
  useEffect(() => {
    import("@waaark/luge/dist/js/luge")
      .then((luge) => {
        luge.lifecycle.refresh()
      })
      .catch((error) => console.error(error));
  })

  return (null);
}

export default LugeReact

And then use it in my pages and it seems to work fine.
Did you manage to get through the build error? What kind of issue do you have now?

Originally posted by @AntoineW in #5 (comment)

I followed this procedure to get Luge to work without throwing an' SyntaxError: Unexpected token 'export'' Error inside a Next JS Application.

But every element that I wrap inside a tag, disappears and is not rendered, regardless of the data-lg attribute added:

https://codesandbox.io/s/naughty-haslett-wzub3?file=/pages/index.js

Is there anything more necessary to instantiate Luge?

Hi,
Here is a Next.js + luge sandbox https://codesandbox.io/s/magical-ramanujan-3njk4

Does it help?