react-native-web icon indicating copy to clipboard operation
react-native-web copied to clipboard

`react-native/Libraries/NewAppScreen` not implemented, causes issues and confusion

Open tringenbach opened this issue 8 months ago • 0 comments

Is there an existing request?

  • [x] I have searched for this request

Describe the feature request

The modules in react-native/Libraries/NewAppScreen are used by some generators when creating a new React Native project. But as far as I can tell, there's not a way to make them just work in react-native-web as they do a lot of relative ../../ imports.

It seems like platforms are supposed to override this import.

I think this is an important enhancement because the current behavior causes a lot of unnecessary pain. I wasted some time because I thought my configuration was completely broken, when in fact it was working in general, just not for NewAppScreen.

For me, I had generated a new project with Repack, and was attempting to add a react-native-web build option to the generated project. (I was bypassing Repack and using rspack directly. Repack does not have built in web support, so I considered this a bit exploratory on my part.)

I thought my configuration was a lot more broken than it was. It would have saved me a lot of time if this had just worked.

When I searched this project's issue tracker, I see two other instances of folks running into the same issue and losing some time to it:

  • https://github.com/necolas/react-native-web/issues/1887
  • https://github.com/necolas/react-native-web/issues/1257

I also found https://github.com/react-native-community/discussions-and-proposals/issues/178 (which links to https://github.com/react-native-community/discussions-and-proposals/issues/122 ) which seems to say that platforms are expected to implement their own version of NewAppScreen. Or were in 2019, I don't know if the policy has changed since then.

This seems fairly low effort. Copy and paste the files into react-native-web, clean up the import statements, and maybe update some links to point to react-native-web's docs. I'd be willing to contribute a PR if this project is open to that approach.

tringenbach avatar Apr 21 '25 15:04 tringenbach