D
Deno

help

Syntax error when getting prop children Element but compiles

Aataractic8/1/2023
Is this error important? How can I fix it? Should I fix it?
Mmarvinh.8/1/2023
That error is a type-only error and won't affect how your project runs. Nonetheless I'm curious how it came to be. Do you have a reproduction case we could take a look at?
Aataractic8/1/2023
I just created the Section component and put Element type for the children Then I pass the div containing the chart. Finally vscode gives me this error
Mmarvinh.8/1/2023
ohh right, I just noticed. The Element type refers to a DOM node in the browser. But here in JSX we are not dealing with actual DOM nodes. The whole idea behind JSX is that you only deal with JSX objects. That's why TS is complaining here. What you want to use as a type instead is ComponentChildren from preact you can think of the JSX as being only a description based on which the final HTML Elements will be created in the browser
Aataractic8/1/2023
Thank you! There is so much types named Element that I chose the simplest
Mmarvinh.8/1/2023
hehe yeah there is definitely a worrying number of these. It's easy to mix them up 😅
Aataractic8/1/2023
While I'm at it, does ComponentChildren works with multiple children elements?
Mmarvinh.8/1/2023
yes iirc it's the catchall type we use in Preact
Aataractic8/1/2023
Thanks 👍

Looking for more? Join the community!

Recommended Posts
Generate jUnit XML file from Deno TestsHey is it possible that the Deno Test suite generates a jUnit XML about the Test? So that I can dispHow to do callbacks with `deno_core`?Hello! I've been inspired to write an application after reading this article: https://deno.com/blog/How to ignore ts error when bundling?I run ``` deno bundle '.main.ts' fibery.js ``` and it refuses to work due to 41 errors. Mostly theyStreaming FormDataI have `Deno.serve` a HTML page with `<form enctype="multipart/form-data">` with a `file` input. IAstro - Vs code templateI am deploying this app using the deno deploy. My app's root is available at https://antilibrary-asdenodrivers/sqlite and deno-sqlit behave different with multiple `?` argsI wanted to understand why these return different results ```ts Deno.test("DB()", (_) => { // Want to write a small NPM package that's for all contextsdeno, browser and node is this April 2022 resource the best one for this? https://portal.gitnation.oSite runs fine but vscode is filled with errors.Kinda annoying, any ideas why?Is there a way to disable Deno Deploy server timing out in ~5 1/2 minutes?Is there a way to disable Deno Deploy server timing out in ~5 1/2 minutes?Object to tuple of tuple of keys and type?Example: ```ts type SomeType = { owo: string uwu: number } ``` Into ```ts type SomeType = [ ["typescript compiler (38.24MB) included in bundle when importing google's npm:schema-dtsNot sure if this is a bug, but I couldn't see how the package imports the compiler. create a ts fildebug why a file is importedI get a compilation error from a ts file that shouldn't be imported. How can I debug the import chaiCan I rename my deno.land package?Is it possible? What should I do?Deno Compile in NixOS docker imageI'm trying to compile code to deploy to aws lambda functions. I can do it locally on my m1 mac just Discord User Authentication WebsiteCan anyone help me create a web server that allows users to login to their discord account and then Dynamic interfacesIs it possible to have like an interface that has a type entry and when it is a string for example tDisable / Replace Loading FaviconHaven't found anything regarding it and likely is not possible, however I thought I might as well sDeno test Leaking resourcesHi i currently try to get used to deno.test but Deno.readTextFile makes the test end in the followinDeno.Command arg with an asterisk?I am trying to execute a shell command from Deno, where one of the command args contains an asterisk`deno compile` in Nix results in `deno repl` starting instead of actual programI wrote following Nix impure derivation for my Deno app: ```nix packages.api = pkgs.stdenv.mkDerivat