Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for data atributes #2

Open
libasoles opened this issue Nov 6, 2021 · 2 comments
Open

Support for data atributes #2

libasoles opened this issue Nov 6, 2021 · 2 comments
Labels
enhancement New feature or request

Comments

@libasoles
Copy link

Hi. Great library, thank for your effort.

I have a suggestion (but won't make a PR myself). This chunk of code would support data attributes:

if(name.startsWith("data-")) {
  // @ts-ignore
  elem.setAttribute(name, attrVal)
}

I tested it adding it on line 155, right there:
https://github.com/itsjavi/jsx-runtime/blob/a38a59cf144ac348a29cac07b1d5250f2de21b58/src/jsx-runtime/index.ts#L115

And it works just fine.

@itsjavi
Copy link
Owner

itsjavi commented Dec 10, 2021

@libasoles thanks for your findings, I definitely want to come back to improve this package and it's nice to see some real-world projects using it

I see that you are using it in https://github.com/libasoles/croquet-findaslot-app it's very cool
can I mention it in the readme ? :)

@itsjavi itsjavi added the enhancement New feature or request label Dec 10, 2021
@libasoles
Copy link
Author

Sure, be my guest. It's a beta version but it-s going good.

And yeah, using jsx-runtime improved a lot the DX, so I'm glad you want to iterate and improve the package.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants