#useEffect for server side?

18 messages · Page 1 of 1 (latest)

visual holly
#

Any method for server side rendering?

wise token
#

What exactly would you try to accomplish with that?

visual holly
lucid slate
visual holly
#

I've tried getServerSideProps() just to print simple hello text, but it doesn't work, file in app/result/page.jsx when i access localhost/result it just empty page. ```import React from "react";

const A = ({ a }) => {
return (
<div>
<p>{a}</p>
</div>
);
};

export async function getServerSideProps() {
const a = "hellooo";
return {
props: { a },
};
}

export default A; ```

lucid slate
#

Are you ysing pages folder?

visual holly
lucid slate
#

If ure using app folder, you dont need to use GetServerSideProps anymore

#

Component in App folders are server component by default

#

So just type A inside div it will be ssr'd

#

Or get any data using await

visual holly
lucid slate
#

Look up the data fetching in the docs

visual holly
#

So all files in app folder is already SSR?

lucid slate
#

Explicitly

visual holly