Comments (10)
Hi, I haven't. @morsdyce ?
from reusable.
I haven't used react 17 yet due to some bugs occurring in component libraries but it's usually related to event handling and not state.
Could you reproduce the issue with any of the examples we have?
from reusable.
from reusable.
create store:
export const useStore = createStore(() => useState({}));
and use them:
const store = useStore()
returns store === null
for the React 17
from reusable.
There is a different babel version in the react 17. Could it be a reason?
from reusable.
Babel shouldn't be the issue as we don't convert syntax using a babel plugin.
I tried reproducing a simple example with React 17 and it worked:
https://codesandbox.io/s/compassionate-fog-ltf4x?file=/src/App.js
It would really help if you could send an example of it not working correctly
from reusable.
one more note, I use react native. It not depends from react-dom
from reusable.
@gev could you reproduce the issue on expo? I don't have an environment ready for react-native
from reusable.
Can't reproduce at expo. All works as well.
On my envirenment bug exists when import custom hook from module.
from reusable.
create store:
export const useStore = createStore(() => useState({}));
and use them:
const store = useStore()
returns
store === null
for the React 17
We had a very similar issue in react-native with React 17 that appears to be caused by the import for the store not actually executing the imported file until a function from it is used. With stores that usually happens within the render method, during which you don't want to be changing around your stores. The solution was to add an "empty" import of the store directly to our App.tsx: import 'stores/thestore'
from reusable.
Related Issues (20)
- Multiple Stores Question HOT 3
- Passing setup data to Reusable stores HOT 2
- Show github repo under npm package HOT 1
- Are you still using it? HOT 2
- Recoil HOT 3
- Bug: Async state updates in React 17 HOT 4
- Check babel macro correctness
- Add global object for debugging that allows exploring stores and cached values
- Add logger HOT 2
- Support case of nested ReusableProviders HOT 2
- Add example - testing stores
- Add SSR example
- wrong input behaviour only when using store HOT 1
- Code example typo in readme HOT 1
- Is it possible to have multiple root providers and still share the same store HOT 4
- overriding areEqual without using selectors HOT 3
- Error "TypeError r is not a function" occurs when calling store with argument HOT 1
- Having Multiple Reusable provider renders component Multiple times HOT 4
- Forking to Dart/Flutter HOT 8
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from reusable.