Next.js + Expo monorepo with blitz #3381
Unanswered
wyattades
asked this question in
Show and tell
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Greetings! The pivot to a framework-agnostic toolkit re-sparked my interest in blitz, purely for use of the zero-api queries/mutations feature (
@blitzjs/rpc
).I managed to successfully* create a proof-of-concept monorepo containing a Next.js and Expo project that share all their UI code and data-fetching logic with
blitz@2.0.0-alpha.26
: https://github.com/wyattades/tely-app-demoI wanted to create and share this project with the blitz team to help inform the development for non-next.js platforms. Here were some of the quirks I encountered:
useRouter
, but the Next.js router context is not available in a native app, so I replacednext/router
module with a no-op module.window.addEventListener
,localStorage
(@blitzjs/auth
only? might be able to exclude this package from the native app)process.env.__NEXT_ROUTER_BASEPATH = ...
, but it could a blitz config value?I think some of these issues could be fixed by relaxing some usage of Next.js/web APIs (e.g.
window.addEventListener?.(...)
, e.g.useRouter()?.isReady
) or by continuing to separate Next.js/web code from the@blitzjs/rpc
project.Beta Was this translation helpful? Give feedback.
All reactions