Closed JanKaul closed 1 year ago
It looks like some React internals doesn't work in this way. This works fine:
change index.tsx
to this:
import { Index } from "./src/components/index.tsx";
export default function () {
return <Index />
}
The index
component doesn't return anything. You need to add a return
.
alternatively, you can create Lume components:
_components/index.tsx
and export it as default.comp
variable with all components found:
export default function ({ comp }) {
return <comp.Index />
}
It looks like some React internals doesn't work in this way. This works fine:
change
index.tsx
to this:import { Index } from "./src/components/index.tsx"; export default function () { return <Index /> }
The
index
component doesn't return anything. You need to add areturn
.
Ah great. That fixed the issue. Thank you. The return somehow got lost when I tried to make a small example.
Expected behavior
Being able to use React hooks in React components for creating a static site with Lume.
Component:
Config:
Actual behavior
Error when running lume build task:
Steps to reproduce
Clone https://github.com/JanKaul/test-lume-react and run
deno task build