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
Currently the return type of App.render is RenderableType; in our docs and in most places we talk about App.render returning a RenderResult. RenderResult is an alias for RenderableType and is a top-level value in textual.app.
This can cause a lint/type warning in dev's apps if they let their IDE complete the signature when writing their own render method, as it will often complete to something like this:
which in turn will auto-import RenderableType from textual.app. This can then result in a warning like this:
We should change App.render so that it's typed as returning RenderResult rather than RenderableType, then such completion will use the type that is exported from textual.app.
This seems a simple enough fix that I could help (if wanted!). But I can't seem reproduce this in my editor, so I just wanted to check where you've seen/tested this?
[EDIT: I'm assuming certainly in VSCode from other instances I found. I've gone ahead with a PR but needs a double-check that this is indeed the fix!]
Currently the return type of
App.render
isRenderableType
; in our docs and in most places we talk aboutApp.render
returning aRenderResult
.RenderResult
is an alias forRenderableType
and is a top-level value intextual.app
.This can cause a lint/type warning in dev's apps if they let their IDE complete the signature when writing their own
render
method, as it will often complete to something like this:which in turn will auto-import
RenderableType
fromtextual.app
. This can then result in a warning like this:We should change
App.render
so that it's typed as returningRenderResult
rather thanRenderableType
, then such completion will use the type that is exported fromtextual.app
.Also note that the code in the compose/render HOWTO seems to have fallen foul of this and has that type warning.
The text was updated successfully, but these errors were encountered: