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

jsx typing problem #9

Closed
c7h12 opened this issue Feb 8, 2021 · 2 comments
Closed

jsx typing problem #9

c7h12 opened this issue Feb 8, 2021 · 2 comments

Comments

@c7h12
Copy link

c7h12 commented Feb 8, 2021

I am using vscode, and the follow code

export const Article = ({ html }: { html: string }) => {
  return jsx`<div class="article-content">${html}</div>`;
};

results
image
in vscode.

The type defining of jsx accepts just one param named statics, can it be fixed?

export const build = function (statics: any) {

@yandeu
Copy link
Member

yandeu commented Feb 8, 2021

Looks like this works. What do you think?

- export const build = function (statics: any) {
+ export const build = function (...statics: any) {
+   statics = statics.flat()

@c7h12
Copy link
Author

c7h12 commented Feb 9, 2021

What about This?

export const build = function (statics: string[],...rest:any[]) {
  const fields = [0,...rest]

@yandeu yandeu closed this as completed in 094eeb8 Feb 22, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants