-
Notifications
You must be signed in to change notification settings - Fork 89
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
[UI-REACT]: usage with preact
leads to cannot read properties of undefined
of ReactSharedInternals.ReactCurrentOwner.current
#247
Comments
ReactSharedInternals.ReactCurrentOwner.current
preact
leads to cannot read properties of undefined
of ReactSharedInternals.ReactCurrentOwner.current
I see something similar over there: excalidraw/excalidraw#5909 (comment) rollupOptions: {
external: ['react', 'react-dom', '@tonconnect/ui'],
output: {
globals: {
react: 'React',
'react-dom': 'ReactDOM',
'react-dom/client': 'ReactDOMClient',
'react/jsx-runtime': 'ReactJSXRuntime',
'@tonconnect/ui': 'TON_CONNECT_UI'
}
}
} I'll try to patch and will report back btw, that's how they fixed it: |
Yup, I solved it, gonna make a PR, here's a codesandbox with patched thing: |
Hi @T-Damer , I am facing the same issue while integrating the tonWallet in my preact app. Can you please share the link to your sandbox again as its now showing up. It would be of great help. |
Maybe someone has already created a dedicated solution for this problem in a separate package? |
Describe the bug
I just created a
preact
project and used the@tonconnect/ui-react
:It leads to:
@tonconnect_ui-react.js?v=77482234:18856 Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'current')
I inspected the source and found full the cause, it looks like this:
ReactCurrentOwner.current
- causes the issue, it's created like:Expected behavior
preact
works fine with manyreact
specific libraries, can we have a support for it? My project is written usingpreact
, instead of plainreact
, can't spend time rewriting everything to enable the libraryCurrent behavior
I have an error when I use the
TonConnectUIProvider
wrapper:Steps to Reproduce
Environment
Additional context
In my app I also wrap everything into
SDKProvider
from'@telegram-apps/sdk-react'
, but it doesn't affect the error, I also tried fixing by aliasing invite.config.ts
:It didn't help, also tried redefining global object:
It didn't help either
The text was updated successfully, but these errors were encountered: