sholladay / pogo

Server framework for Deno
Mozilla Public License 2.0
482 stars 33 forks source link

Support for React@17 #63

Closed dvdprrsh closed 2 years ago

dvdprrsh commented 3 years ago

There seem to be type conflicts (I believe) between pogo and React 17.

Here is the import map for all dependencies. (react-dom is in there twice for react-dom/server)

{
  "imports": {
    "pogo": "https://deno.land/x/pogo@v0.5.2/main.ts",
    "react": "https://cdn.skypack.dev/react@^17?dts",
    "react-dom": "https://cdn.skypack.dev/react-dom@^17?dts",
    "react-dom/": "https://dev.jspm.io/react-dom@17.0.2/"
  }
}

Here is a bit of errors from the deno type checking

TS2717 [ERROR]: Subsequent property declarations must have the same type.  Property 'tspan' must be of type 'SVGProps<SVGTSpanElement>', but here has type 'SVGProps<SVGTSpanElement>'.
            tspan: React.SVGProps<SVGTSpanElement>;
            ~~~~~
    at https://cdn.skypack.dev/-/react@v17.0.1-yH0aYV1FOvoIPeKBbHxg/dist=es2020,mode=types/index.d.ts:3170:13

    'tspan' was also declared here.
          tspan: React.SVGProps<SVGTSpanElement>;
          ~~~~~
        at https://raw.githubusercontent.com/soremwar/deno_types/b5a146610e2c97c1612371fcf610b541f950ee73/react/v16.13.1/react.d.ts:3822:7

TS2717 [ERROR]: Subsequent property declarations must have the same type.  Property 'use' must be of type 'SVGProps<SVGUseElement>', but here has type 'SVGProps<SVGUseElement>'.
            use: React.SVGProps<SVGUseElement>;
            ~~~
    at https://cdn.skypack.dev/-/react@v17.0.1-yH0aYV1FOvoIPeKBbHxg/dist=es2020,mode=types/index.d.ts:3171:13

    'use' was also declared here.
          use: React.SVGProps<SVGUseElement>;
          ~~~
        at https://raw.githubusercontent.com/soremwar/deno_types/b5a146610e2c97c1612371fcf610b541f950ee73/react/v16.13.1/react.d.ts:3823:7

TS2717 [ERROR]: Subsequent property declarations must have the same type.  Property 'view' must be of type 'SVGProps<SVGViewElement>', but here has type 'SVGProps<SVGViewElement>'.
            view: React.SVGProps<SVGViewElement>;
            ~~~~
    at https://cdn.skypack.dev/-/react@v17.0.1-yH0aYV1FOvoIPeKBbHxg/dist=es2020,mode=types/index.d.ts:3172:13

    'view' was also declared here.
          view: React.SVGProps<SVGViewElement>;
          ~~~~
        at https://raw.githubusercontent.com/soremwar/deno_types/b5a146610e2c97c1612371fcf610b541f950ee73/react/v16.13.1/react.d.ts:3824:7

Found 180 errors.

Feel free to ask if you have any other questions! :)

sholladay commented 3 years ago

Last time I checked, Deno doesn't support React 17.

sholladay commented 2 years ago

I just tried React 17 again and it seems to be working now on recent Deno versions. I'm updating Pogo's internal version of React to v17 in PR https://github.com/sholladay/pogo/pull/68. Please give that branch a try if you have time and let me know if you run into any problems so I can fix them before release.