question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Decoupling from react and react-native

See original GitHub issue

I’m trying to integrate redux-persist (5.10.0) (I haven’t used it before so sorry if I’m doing an obvious mistake) into an external node module, which will be shared by an iOS app and web app.

I’ve installed redux-persist, configured it, and ran. I get:

node_modules/redux-persist/src/index.d.ts:69:46 - error TS2307: Cannot find module 'react'.

69     import { ReactNode, PureComponent } from "react";
                                                ~~~~~~~

node_modules/redux-persist/src/index.d.ts:91:38 - error TS2304: Cannot find name 'React'.

91     export class PersistGate extends React.PureComponent<PersistGateProps, PersistorGateState> { }
    

How do I configure my package that it doesn’t require either React or Reach Native?

Issue Analytics

  • State:open
  • Created 4 years ago
  • Reactions:2
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
canpoyrazoglucommented, May 9, 2019

@rt2zz I’ve installed @next (+ redux-persist@6.0.0-pre1), but still getting the same error:

> tsc

node_modules/redux-persist/types/integration/react.d.ts:2:44 - error TS2307: Cannot find module 'react'.

2   import { ReactNode, PureComponent } from "react";
                                             ~~~~~~~

node_modules/redux-persist/types/integration/react.d.ts:24:29 - error TS2304: Cannot find name 'React'.

24   class PersistGate extends React.PureComponent<PersistGateProps, PersistorGateState> {}
                               ~~~~~

0reactions
bitflowercommented, Dec 26, 2019

Same here using Stencil JS. I comment out react related stuff for now which is really dirty.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Decoupling Logic From React Components | by Daniel Kiesshau
There are 6 ways (explored in this article) to achieve the decoupling. Each of them have their pros and cons. And we should...
Read more >
Build Decoupled React Components with Inversion of Control
I hope that this article helped you to understand how to use inversion of control with react and how to decouple your code...
Read more >
How To Decouple Data from UI in React | by Suhan Wijaya
In Part 1, I presented an approach to decouple the data fetching/management layer from a React component that renders some UI based on...
Read more >
React: decoupling UI and business logic - YouTube
Hello everyone and welcome to our third stream! At the end of our last stream we managed to have a working React form,...
Read more >
Decoupling Drupal with React Native - YouTube
In this session, we talk about decoupling Drupal and building a Decoupled Days event application in React Native, with Redux, Redux-thunk ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found