React router hot-reload not working

I have a small problem there are few similar questions on SA already but I can't figure out how to fix this. I am using react-router-redux but for this example I don't think there are any...

How can I update the parent's state in React?

My structure looks as follows: Component 1 - |- Component 2 - - |- Component 4 - - - |- Component 5 Component 3 Component 3 should display some data depending on state of Component...

How to update or add to immutable.js List

I'm using Redux and Immutable.js in my React-based project (built on React Boilerplate) and I'm looking for an idiomatic way to update or add to an Immutable.js List. My current setup. State...

React router, pass data when navigating programmatically?

We could navigate to different path using this.props.router.push('/some/path') Is there a way to send params (object) along when navigating? There are other options I can think of, but wonder if...

In React ES6, why does the input field lose focus after typing a character?

In my component below, the input field loses focus after typing a character. While using Chrome's Inspector, it looks like the whole form is being re-rendered instead of just the value attribute...

React.createElement: type is invalid -- expected a string

Trying to get react-router (v4.0.0) and react-hot-loader (3.0.0-beta.6) to play nicely, but getting the following error in the browser console: Warning: React.createElement: type is invalid --...

React-Redux: Actions must be plain objects. Use custom middleware for async actions

Unhandled Rejection (Error): Actions must be plain objects. Use custom middleware for async actions. I wanted to add comments with every posts. So when fetch posts are run I want to call fetch...

yarn is having troubles with the network connection

I tried to install a package with yarn earlier today and I got this yarn install yarn install v1.9.4 [1/4] 🔍 Resolving packages... info There appears to be trouble with your network...

Module not found: Error: Can't resolve 'core-js/es6'

I've got a problem with my build process in relation to my React app. I always get the following error: Module not found: Error: Can't resolve 'core-js/es6' if I use this in a polyfill.js: import...

How to fix "FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory" error

I'm trying to deploy a reactjs application to heroku. While compiling assets, the build fails and produces this error: -----> Ruby app detected -----> Compiling Ruby/Rails -----> Using Ruby...

NextJS - export is broken (no CSS, no JS)

I am using NextJS (https://nextjs.org/) Version 9.0.6. My next.config.js looks like this: /* eslint-disable */ const withLess = require("@zeit/next-less"); const lessToJS =...

REST API EXPRESS JS: Can not download file in Reactjs, which is send by back-end

I created REST API using Express JS to send Excel file: app.get('/download/', async (req, res) => { try { await res.download('./ExcelCopy.xlsx'); } catch (e) { ...

How to use Redux-Thunk with Redux Toolkit's createSlice?

==================== TLDR ========================== @markerikson (see accepted answer) kindly pointed towards a current solution and a future solution. EDIT: 15th Nov 2020: Link to Docs to use...

How to read from redux persisted store (localstorage)

I have a redux persist configuration like this: const persistConfig = { key: 'persistedStore', storage: storage, transforms: [expireIn(expireTime, expirationKey, []), encryptor], whitelist:...

React - TypeError: baseReducer is not a function

im making a SPA using React. I want the states persits after page refresh so i used 'redux-persist'. I dont know if my import 'allReducers' is wrong because the message i recived is TypeError:...

How to implement loading screen in Next.js

I am new in nextjs and using nextjs v9.3, next-redux-wrapper v5, @material-ui/core v4.2, and custom express server. I am trying to implement a loading screen when changing routes in my Nextjs app...

Testing useSubscription apollo hooks with react

Testing the useSubscription hook I'm finding a bit difficult, since the method is omitted/not documented on the Apollo docs (at time of writing). Presumably, it should be mocked using the...

How can I fix `Using UNSAFE_componentWillMount in strict mode is not recommended and may indicate bugs in your code.`?

I'm using redux forms in react project and this is the app component which has redux forms intialized : import { Field, reduxForm } from 'redux-form'; const onSubmit = (values) => { ...

How to fix circular dependencies of slices with the RootState?

I recently started using redux-toolkit and started writing my reducers using the createSlice following their docs. One reducer, let's call it reducerA, imports customAsyncFunction to handle its...

Redux State Problem : TypeError: undefined is not an object

I am new to react native and redux especialy and I got an error message that I really struggle to deal with. This is the error im getting TypeError: undefined is not an object (evaluating...

react native android app restarts when opened by clicking app icon (coming from background)

I open my app by clicking icon, do something and going to another component, pause the app by clicking home button. If I open my app by clicking icon again, the app restarts and going first...

useCallback usage with fetching inside useEffect not correct- ReactJS

I want to achieve the following. Action from redux is imported in this component. It fetches data from firebase database. Data is displayed inside this component. My problem that due to...

Redux Persist + Redux toolkit $CombinedState error

I'm trying to add redux persist to redux toolkit but for some reason I get an Exported variable 'store' has or is using name '$CombinedState' from external module ".../node_modules/redux/index"...

Exported variable 'store' has or is using name '$CombinedState' from external module error Redux toolkit and redux persist

Hi I'm trying to get redux persist working with redux toolkit (also in typescript) I'm getting the following error: Exported variable 'store' has or is using name '$CombinedState' from external...

Problem with react-native-papere Theme using Expo and Stack Navigation

I'm working with Expo to create a mobile app with react native, I'm trying to include styles with react-native-paper and applying a custom theme to the whole project, but it doesn't apply any...

useLeafletContext() can only be used in a descendant of <MapContainer>

I am in the process of converting a leaflet-map in React into a hook with the use of react-leaflet and react-leaflet-markercluster. Everything worked perfectly except the use of the MarkerCluster...

Chain 2 queries in RTK Query

What is the proper way to chain queries if the 2nd query requires a parameter that is returned by the 1st? const { data: user } = useGetUserQuery(); The user object contains an ID that is used to...

Jest not exiting properly when using RTK-Query useLazyQuery with ReactNative

I'm trying to test some functionality I've written using RTK-Query. Ive created an api using createApi and have exported the useLazyQuery hook. I am calling this hook and then listening for...

Unable to load @webpack-cli/serve

I downloaded a project folder from a pluralsight tutorial, when I try to run it with npm start it shows this message: [webpack-cli] Unable to load '@webpack-cli/serve' command [webpack-cli]...

You may need an additional loader to handle the result of these loaders (upgrading Monaco Editor)

I wanted to upgrade the version of Monaco Editor to v0.31.1. I did npm install [email protected], and the recompilation gave me the following error: Failed to...