Custom App documentation example - formMiddleware
See original GitHub issueWhat you were expecting:
By following tutorial at https://marmelab.com/react-admin/CustomApp.html I should be able to configure custom provider.
What happened instead:
Got an exception:
redux.js:567 Uncaught TypeError: middleware is not a function
at redux.js:567
at Array.map (<anonymous>)
at redux.js:566
at <anonymous>:1:28482
at Module.createStore (redux.js:87)
at Object.configureStore [as default] (configure-store.ts:49)
at Object../src/redux.ts (redux.ts:9)
at __webpack_require__ (bootstrap:721)
at fn (bootstrap:98)
at Object../src/index.tsx (index.tsx:7)
at __webpack_require__ (bootstrap:721)
at fn (bootstrap:98)
at Object.0 (serializer.ts:4)
at __webpack_require__ (bootstrap:721)
at ./node_modules/@babel/runtime/helpers/arrayWithoutHoles.js.module.exports (bootstrap:788)
at bootstrap:788
Steps to reproduce:
Following the docs for CustomApp.
Related code:
https://github.com/marmelab/react-admin/pull/2249/files#diff-48a1c77367d4a9f0308adfcc0157fc29L17 It seems the middleware was removed and no longer needed.
Environment
- React-admin version: 2.3.0
- React version: 16.3.0
Also, it seems the import of formReducer
is missing. I guessed it should have been:
import { reducer as formReducer } from 'redux-form'
Issue Analytics
- State:
- Created 5 years ago
- Reactions:5
- Comments:8 (5 by maintainers)
Top Results From Across the Web
How To Create a Custom Middleware in Express.js
Learn how to write and use your own custom Express.js middleware by using res, req, and next.
Read more >Writing middleware for use in Express apps
Here is a simple example of a middleware function called “myLogger”. This function just prints “LOGGED” when a request to the app passes...
Read more >Write custom ASP.NET Core middleware - Microsoft Learn
Learn how to write custom ASP.NET Core middleware.
Read more >Build and Understand Express Middleware through Examples
This tutorial walks you through creating and understanding middleware for Express.
Read more >Building a Document Browser App for Custom File Formats
Implement a custom document file format to manage user interactions with files on different cloud storage providers.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Seems that this issue still not resolved in 2.4.2, When importing
import { formMiddleware } from 'react-admin';
I am getting:
When importing it directly from node_modules/ra-core/esm/form/formMiddleware, I am unable to build using CRA scripts with the following error:
Hello, I’m trying to create my own store to access from DataProvider but I think I have a similar problem. When I try to implement createAdminStore.js as indicated in the documentation, the following error appears when importing formMiddleware
error: ‘react-admin’ does not contain an export named ‘formMiddleware’.
Versiones React-admin: “2.3.4” React: “16.5.2”