apibara/starknet-react

kararotConnectors() is not compatible with react-native

Closed this issue · 1 comments

Description

The Kakarot library is currently incompatible with React Native applications due to its dependency on browser-specific mipd librairy, which is not available in the React Native environment.

Current Behavior

The library's kakarotConnectors() function uses mipd to discover providers, which internally depends on window.addEventListener(). This implementation fails in React Native as the window object differs from browser environments.

Expected Behavior

The library should provide a platform-agnostic implementation for provider discovery that works in both web and React Native environments, or offer an alternative implementation for React Native.

Additional Context

Our current implementation attempts to use kakarotConnectors() in combination with useInjectedConnectors() and StarknetConfig
Implementation reference: https://github.com/AFK-AlignedFamKernel/afk_monorepo/blob/main/apps/mobile/src/app/StarknetProvider.tsx

Related Issues/PRs

Related PR: AFK-AlignedFamKernel/afk_monorepo#321

Unfortunately the kakarot connector will go away since there won't be a mainnet launch.