no-redux | ️ Experimenting with using hooks | Frontend Utils library
kandi X-RAY | no-redux Summary
kandi X-RAY | no-redux Summary
️ Experimenting with using hooks and context instead of Redux
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of no-redux
no-redux Key Features
no-redux Examples and Code Snippets
Community Discussions
Trending Discussions on no-redux
QUESTION
I've been searching for a while about React's hooks now, and one question became persistent in my head. Will hooks overthrown redux? This is a fairly old discussion so first a little bit of context :
- State Management with React Hooks — No Redux or Context API
- What do Hooks mean for popular APIs like Redux connect() and React Router?
- redux-react-hook
A lot of people (React's team included) seens to think that redux and similars will just going to adapt to the new API, turning the HOC's approach obsolete, but my question is:
With custom hooks, use reducer, and a well thought logic why do I need Redux at all? I mean, isn't just more performatic to dispatch your actions to a single reducer? I've found a lot of material about it, but none of those seems to have a definitive answer (maybe because there aren't one?), so I would like to know what do you think about Redux's future?
ANSWER
Answered 2019-Apr-10 at 20:21Nope, definitely not.
I addressed this in my Reactathon 2019 talk on "The State of Redux".
Summarizing: hooks mostly offer ways to do the same kinds of things you could already do, like local component state and avoiding prop-drilling via context. If that's all you were using Redux for, then you probably didn't need Redux in the first place. But, hooks have their limitations, and there's lots of additional use cases for choosing Redux.
Also, note that we are currently working on designing a public useRedux()
-type hooks API for React-Redux.
QUESTION
I have applications for movies. I am fetching data from api tmdb. By default, popular videos are shown to me, but I have a list that changes my url to other lists. And now the problem begins. I can't pass url data after onClick to a sibling from the Nav component to the ListApp component. Because I have there one function to close navigation. And also, I do not know how to use them in parent to replacing used url popular.
Code: https://codesandbox.io/s/9z6yll4r6r
Thank you in advance for your help.
Child component Nav.js (here I have list in Nav.js with new url)
...ANSWER
Answered 2019-Jan-10 at 17:54In Parent.js
:
- Create a method called
onLinkChange(e)
which setsthis.state.data
to thee
(url) and pass the method toNavigation
as aprop
. - Give
ListApp
a prop calleddata
and set it tothis.state.data
.
In Nav.js
when you click a link call this.props.onLinkChange(url)
.
When you click on a link, it will call the onLinkChange()
and set the new state of data which would be the URL resulting in the ListApp having access to the new URL through this.props.data
More in-depth explanation here: https://codeburst.io/no-redux-strategy-for-siblings-communication-3db543538959
QUESTION
My jest test errors out but my app transpiles (webpack) and runs without error. I did recently switch to babel-preset-env but I still get the same error.
relevant package.json:
...ANSWER
Answered 2017-Sep-01 at 17:04You have a circular dependency in your code. You can see it in the stacktrace:
QUESTION
I'm using:
I have this 3 code line:
...ANSWER
Answered 2017-Oct-02 at 12:12The solution to this error's type is to change this tsconfig.json from:
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install no-redux
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page