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

No exported PropsWithChildren type #94

Open
jacopo-trompeo opened this issue Aug 7, 2024 · 2 comments
Open

No exported PropsWithChildren type #94

jacopo-trompeo opened this issue Aug 7, 2024 · 2 comments

Comments

@jacopo-trompeo
Copy link

jacopo-trompeo commented Aug 7, 2024

I'm trying to define a layout that takes in some children, but it doesn't look like the library exports a type for it.

Here's the index.d.ts for @elysiajs/html version ^1.1.0

import { createElement } from './h'; 
export * from './html';
export * from './options';
export * from './utils';
export { ErrorBoundary } from '@kitajs/html/error-boundary';
export { Html } from '@kitajs/html';
export { createElement };
export { html as default } from './html';

I saw some examples saying I should use Html.Children or Html.PropsWithChildren, but those are not properties in my Html object. I do however see that kitajs exports a PropsWithChildren type that is not being exposed by the elysia html library.

Can anyone tell me if I'm maybe doing something wrong?

Thanks

@Nmans01
Copy link

Nmans01 commented Aug 20, 2024

At some point, the developer of KitaJS/Html separated some types out of the Html namespace. Among these were Children and PropsWithChildren. The consequence of this is that Elysia/Html no longer includes these types implicitly. To solve the issue, perhaps

export { Html } from '@kitajs/html';

can be changed to

export * from '@kitajs/html';

@simoneguglielmi
Copy link

any news?

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

3 participants