You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
importReactfrom"react";importRoconfrom"rocon";import{useRoutes}from"rocon/react";consttoplevelRoutes=Rocon.Path().exact({action: ()=><p>I am top page</p>,}).route("foo",(route)=>route.action(()=><p>This is foo</p>)).route("bar",(route)=>route.action(()=><p>This is bar</p>));exportconstRoutes: React.FC=()=>{returnuseRoutes(toplevelRoutes);};
$./node_modules/.bin/tsc -v
Version 4.4.4
$ node -v
v16.8.0
Result of running tsc
tsc --noEmit
src/routes.tsx:12:20 - error TS2345: Argument of type 'PathRouteBuilder<unknown, { foo: RouteDefinition<unknown, {}>; bar: RouteDefinition<unknown, {}>; }, "none", "hasaction", {}>' is not assignable to parameter of type 'AttachableRouteBuilder<ReactElement | null, unknown>'.
The types returned by 'getBuilderLink()' are incompatible between these types.
Type 'RouteBuilderLink<unknown, string | undefined>' is not assignable to type 'BuilderLink<ReactElement | null, unknown, RouteBuilderLinkValue<ReactElement | null>>'.
Type 'RouteBuilderLinkValue<unknown>' is not assignable to type 'RouteBuilderLinkValue<ReactElement | null>'.
Type 'unknown' is not assignable to type 'ReactElement | null'.
Type 'unknown' is not assignable to type 'ReactElement'.
12 return useRoutes(toplevelRoutes);
~~~~~~~~~~~~~~
Found 1 error.
The text was updated successfully, but these errors were encountered:
I tried to run sample codes written in official doc, but I got errors from tsc.
app.tsx
routes.tsx
tsconifg
tsc and node version
Result of running
tsc
The text was updated successfully, but these errors were encountered: