Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Documentation examples for Custom Menu throws error #4416

Closed
elsni opened this issue Feb 12, 2020 · 1 comment · Fixed by #4418
Closed

Documentation examples for Custom Menu throws error #4416

elsni opened this issue Feb 12, 2020 · 1 comment · Fixed by #4418
Assignees

Comments

@elsni
Copy link

elsni commented Feb 12, 2020

The example code from the documentation page:
https://marmelab.com/react-admin/Theming.html#using-a-custom-menu

leads to an error:

Error: Expected ref to be a function, a string, an object returned by React.createRef(), or null.

React-admin version: 3.2.1

Module../src/index.js
C:/Users/elsneste/source/eptw/src/index.js:7
4 | import App from './App';
5 | import * as serviceWorker from './serviceWorker';
6 |

7 | ReactDOM.render(, document.getElementById('root'));
8 |
9 | // If you want your app to work offline and load faster, you can change
10 | // unregister() to register() below. Note this comes with some pitfalls.
View compiled
webpack_require
C:/Users/elsneste/source/eptw/webpack/bootstrap:785
782 | };
783 |
784 | // Execute the module function
785 | modules[moduleId].call(module.exports, module, module.exports, hotCreateRequire(moduleId));
| ^ 786 |
787 | // Flag the module as loaded
788 | module.l = true;
View compiled
fn
C:/Users/elsneste/source/eptw/webpack/bootstrap:150
147 | );
148 | hotCurrentParents = [];
149 | }
150 | return webpack_require(request);
| ^ 151 | };
152 | var ObjectFactory = function ObjectFactory(name) {
153 | return {
View compiled
1
http://localhost:3000/static/js/main.chunk.js:6075:18
webpack_require
C:/Users/elsneste/source/eptw/webpack/bootstrap:785
782 | };
783 |
784 | // Execute the module function
785 | modules[moduleId].call(module.exports, module, module.exports, hotCreateRequire(moduleId));
| ^ 786 |
787 | // Flag the module as loaded
788 | module.l = true;
View compiled
checkDeferredModules
C:/Users/elsneste/source/eptw/webpack/bootstrap:45
42 | }
43 | if(fulfilled) {
44 | deferredModules.splice(i--, 1);
45 | result = webpack_require(webpack_require.s = deferredModule[0]);
| ^ 46 | }
47 | }
48 |
View compiled
Array.webpackJsonpCallback [as push]
C:/Users/elsneste/source/eptw/webpack/bootstrap:32
29 | deferredModules.push.apply(deferredModules, executeModules || []);
30 |
31 | // run deferred modules when all chunks ready
32 | return checkDeferredModules();
| ^ 33 | };
34 | function checkDeferredModules() {
35 | var result;
View compiled

@fzaninotto
Copy link
Member

That's because your resources have no icon. I'll update the documentation to avoid that gotcha.

@fzaninotto fzaninotto self-assigned this Feb 13, 2020
akshah123 pushed a commit to akshah123/react-admin that referenced this issue Feb 14, 2020
sdobz pushed a commit to sdobz/react-admin that referenced this issue Feb 20, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants