Skip to content

look into function syntax for onClick #6

@reggi

Description

@reggi

currently calling "new" on an export class is tricky implementation is rudimentary now, but could offer more flexability?

could convert this anon onClick prop to string?

import { Fragment } from "preact";
import { HTMX, HTMXComponents } from "../mod.tsx";

const { component, serve, routes, clientImport } = new HTMXComponents('@reggi/client-code')

const multi = await clientImport('./client_code/multi.ts')

export const OnClick = component('/client-code-on-click', () => {
  return (
    <Fragment>
      <HTMX.div onClick={() => {
        const x = new multi.Dog()
        console.log(x.name)
      }}>Do something else</HTMX.div>
    </Fragment>
  )
})

if (!Deno.env.get('NO_SERVE')) {
  await serve()
}

export { routes }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions