Skip to content
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

with-react-native-web React 18 #41010

Closed
1 task done
AndreasBBS opened this issue Sep 28, 2022 · 6 comments · Fixed by #41024
Closed
1 task done

with-react-native-web React 18 #41010

AndreasBBS opened this issue Sep 28, 2022 · 6 comments · Fixed by #41024
Labels
examples Issue/PR related to examples

Comments

@AndreasBBS
Copy link

Verify canary release

  • I verified that the issue exists in the latest Next.js canary release

Provide environment information

Operating System:
  Platform: linux
  Arch: x64
  Version: #54-Ubuntu SMP Fri Aug 26 13:26:29 UTC 2022
Binaries:
  Node: 16.13.2
  npm: 8.19.2
  Yarn: 1.12.3
  pnpm: N/A
Relevant packages:
  next: 12.3.1
  eslint-config-next: N/A
  react: 18.1.0
  react-dom: 18.1.0

Which example does this report relate to?

with-react-native-web

What browser are you using? (if relevant)

No response

How are you deploying your application? (if relevant)

next start

Describe the Bug

There's not really a bug this is more a question for the future relating to React 18.

In your documentation for the custom document there's a note saying

To prepare for React 18, we recommend avoiding customizing getInitialProps and renderPage, if possible.

How would this example look in a React 18 scenario?
Is this one of the cases where it's not possible to avoid customizing through getInitialProps and renderPage?

Expected Behavior

I would expect to be able to run this example using React 18 without leveraging getInitialProps and renderPage in_document.js

To Reproduce

Does not apply

@AndreasBBS AndreasBBS added the bug Issue was opened via the bug report template. label Sep 28, 2022
@balazsorban44 balazsorban44 added examples Issue/PR related to examples React 18 and removed bug Issue was opened via the bug report template. labels Sep 29, 2022
@balazsorban44
Copy link
Member

Hi, the example should continue working, even if you upgrade to React 18. I upgraded the dependencies. 👍

kodiakhq bot pushed a commit to timneutkens/next.js that referenced this issue Sep 29, 2022
…#41024)

Closes vercel#41010

## Bug

- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Errors have a helpful link attached, see `contributing.md`

## Feature

- [ ] Implements an existing feature request or RFC. Make sure the
feature request has been accepted for implementation before opening a
PR.
- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Documentation added
- [ ] Telemetry added. In case of a feature if it's used or not.
- [ ] Errors have a helpful link attached, see `contributing.md`

## Documentation / Examples

- [ ] Make sure the linting passes by running `pnpm lint`
- [ ] The "examples guidelines" are followed from [our contributing
doc](https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md)
@AndreasBBS
Copy link
Author

I understand that the example still works, my question was regarding how would a refactor be made as to

avoiding customizing getInitialProps and renderPage

Right now the example takes advantage of this method but in the documentation it discourages the usage of this method with React 18. How would the same behavior be achieved without using getInitialProps and renderPage in React 18 is my question.

Thanks for the swift reply and I apologize for marking this as bug which is probably not the right way to raise this issue. Have a nice day.

@steida
Copy link
Contributor

steida commented Oct 5, 2022

@AndreasBBS Did you figure it out?

@AndreasBBS
Copy link
Author

@AndreasBBS Did you figure it out?

Not really. I'm hoping this upcoming even the next team has coming in October might give me more insights.

@steida
Copy link
Contributor

steida commented Oct 5, 2022

I already figured it out. RNfW 0.18 does not enable React 18 features yet, but it's already in https://github.com/necolas/react-native-web/commits/0.19-dev. So I believe the example is OK.

BowlingX pushed a commit to BowlingX/next.js that referenced this issue Oct 5, 2022
…#41024)

Closes vercel#41010

## Bug

- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Errors have a helpful link attached, see `contributing.md`

## Feature

- [ ] Implements an existing feature request or RFC. Make sure the
feature request has been accepted for implementation before opening a
PR.
- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Documentation added
- [ ] Telemetry added. In case of a feature if it's used or not.
- [ ] Errors have a helpful link attached, see `contributing.md`

## Documentation / Examples

- [ ] Make sure the linting passes by running `pnpm lint`
- [ ] The "examples guidelines" are followed from [our contributing
doc](https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md)
@github-actions
Copy link
Contributor

github-actions bot commented Nov 5, 2022

This closed issue has been automatically locked because it had no new activity for a month. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 5, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
examples Issue/PR related to examples
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants