-
Notifications
You must be signed in to change notification settings - Fork 167
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Equivalent of Next.js getServerSideProps in Aleph? #22
Comments
i'm planning to improve the |
It would be good to provide docs for class based components too. |
@mohsenkhanpour i almost forgot how write a class component...but you are definitely right, should provide the |
Something like a withUseDeno hight order component should work. const withUseDeno = (fn) => (Component) => (props) => {
const ssrProps = useDeno(fn);
return <Component {...ssrProps} {...props} />
}
class HelloDeno {
render() {
const { version } = this.props;
return <p>Hello i'm Deno v{version}</p>
}
}
export default withUseDeno(() => ({ version: Deno.version.deno }))(HelloDeno); |
hi @alfredosalzillo, I like the HOC idea, are you interest in implementing it? or i will add it later, also |
I'd like to contribute :) |
IMO having it would be great |
I was reading the documentation about the useDeno hook and it says:
After reading the examples, it appears you can only use the
getStaticProps
approach from Next (ie. fetching data at build time), but that there is no way to use thegetServerSideProps
approach?A common use case for this that I don't understand how to solve in Aleph:
Bearer
token. I want to pass this data as the initial props data to the component. I don't want this code in the frontend bundle.Is this use case not supported in Aleph? If not, it hampers the functionality to unusable levels for our projects. If it is indeed possible, can you please document how to use
useDeno
together with dynamic SSR that can fetch data on each request?The text was updated successfully, but these errors were encountered: