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
I believe probably other frameworks/libraries would enjoy this as well as it makes a smoother integration
Non-Goals
replace next/dynamic
Background
There's no known alternatives, but i can't be sure.
Proposal
importdynamic,{Loader,DynamicOptions}from"next/dynamic";typeDynamicProps<T>={loader: Loader<T>;}&DynamicOptions<T>;exportdefaultfunctionDynamic<T>(props: DynamicProps<T>){const{ loader, ...options}=props;constComponent=dynamic(loader,options);// currently fails because Next complains that the `loader` should be an inline functionreturn<Component/>;}
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
Goals
Have a component version of this, mainly for fitting into other frameworks such as
react-router-dom
. The use-case is to achieve this:like that:
I believe probably other frameworks/libraries would enjoy this as well as it makes a smoother integration
Non-Goals
next/dynamic
Background
There's no known alternatives, but i can't be sure.
Proposal
Beta Was this translation helpful? Give feedback.
All reactions