deprecation of renderAsync
and usage of its implementation on render
#1144
gabrielmfern
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Goals
Background
After some users reported problems with NextJS when using
render
(see issue with renderToStaticMarkup on NextJS), I had always to answer for them to userenderAsync
, and keeping this is not sustainable unless we either have docs on this or we deprecaterender
in favor ofrenderAsync
. The best one is the latter in my opinion as, after experimentation with creating a Chart component, I had to use Suspense which the usualrender
didn't allow for.Having support for Suspense would be a great DX improvement as it could lead to the possibility of allowing to fetch code inside of the components instead of always having to pass this through props. We could have something similar and much more minimal to TanStack Query's
useQuery
that would allow for fetching inside of them which I have also experimented with. (#1266)Even more in favor of this, is that the
renderToStaticMarkup
thatrender
uses under the hood is recommended against, both in React's docs, as well as in migrating to react 18 and the depreacted react apis on eslint.Proposal
The best path I believe is to completely replace the implementation of
render
with the one fromrenderAsync
and default to it. Maybe by deprecatingrenderAsync
for this.Beta Was this translation helpful? Give feedback.
All reactions