Conversation
|
Hi! Thanks for the PR! I've never used RN Web before - how do I test this out? Could you also add a web app to the example/ so I can test it? |
|
Made suggested changes @mrousavy |
mrousavy
left a comment
There was a problem hiding this comment.
okay I have left a few nitpicking comments, I'd like them to be resolved (only affects example). After that, I think everything looks perfect 👌
|
I made the further suggested edits. |
|
So I ran the App for iOS and Android and nothing seems to be broken there, so that's good. However, when I run |
|
Actually the native app also breaks by this PR. This must be some issue with the new babel config: A quick stackoverflow search showed me a possible approach, however I don't think that is a solution but rather a wacky workaround. Can we make the babel config only apply to the web project and leave the normal config for the native apps as is? Surely react-native-web has a solution for this. |
mrousavy
left a comment
There was a problem hiding this comment.
see my 2 comments above.
- Can't run
yarn webto see the app. - Native example app breaks because of the babel config changes.
| ] | ||
| }, | ||
| "globals": { | ||
| "localStorage": true |
There was a problem hiding this comment.
Potentially better to add /* global localStorage */ to the top of src/index.web.ts, since it's only available as a global on the web platform, and not to the rest of the code...
| "@react-native-community/eslint-config": "^2.0.0", | ||
| "@release-it/conventional-changelog": "^2.0.0", | ||
| "@types/jest": "^26.0.0", | ||
| "@types/node": "^14.14.37", |
There was a problem hiding this comment.
Sorry if I'm missing something obvious, but I cannot find where these types are used?
Types in the @types/node package are only available when running inside Node.js, not in the browser which this new code is targeting, right?
|
I think it would be easier to have a separate example folder for web, and just use a minimal expo web template. |
|
RN MMKV now supports web 🎉 |
Addressing suggestion in #11 with localStorage support.