I have a stateless, functional component in NextJS where I'm trying to initialize some data upon load using getInitialProps()
:
const LoginModal = props => (
<p>{props.testdata}</p>
);
LoginModal.getInitialProps = () => ({ testdata: 'Some string value' });
export default LoginModal;
However, no matter what I do, it always renders with a blank <p></p>
. Why isn't the value returned by getInitialProps()
being read by the component?