title: How is the correct way to have multiple dataProviders in react-admin?
body: <p>I'm trying to use multiple dataproviders in a react-admin project but I have an error:</p>
  
  <pre><code>Warning: Missing translation for key: "dataProvider is not a function"
  function.console.(anonymous function) @ index.js:1452
  </code></pre>
  
  <p>I have my <code>App.js</code> like this:</p>
  
  <pre><code>import React from 'react';
  import { render } from 'react-dom';
  import { Admin, Resource } from 'react-admin';
  import dataProviders from './service/dataproviders';
  import UserList1,  from './users1';
  import UserList2,  from './users2';
  
  const App = () =&gt; (
    render(
      &lt;Admin dataProvider={dataProviders}&gt;
        &lt;Resource name="users1" list={UserList1} /&gt;
        &lt;Resource name="users2" list={UserList2} /&gt;
      &lt;/Admin&gt;,
      document.getElementById('root'),
    )
  );
  
  export default App;
  </code></pre>
  
  <p>And I have the <code>dataproviders.js</code> file:</p>
  
  <pre><code>import simpleRestProvider from 'ra-data-simple-rest';
  
  const dataProviders = [
    { dataProvider: simpleRestProvider('http://path.to.foo.api1'), resources: ['users1'] },
    { dataProvider: simpleRestProvider('http://path.to.foo.api2'), resources: ['users2'] },
  ];
  
  export default (type, resource, params) =&gt; {
    const dataProvider = dataProviders.find(dp =&gt; dp.resources.includes(resource));
    return dataProvider(type, resource, params);
  };
  </code></pre>
  
  <p>How it's the correct way?</p>
  
  <p>I check this post: </p>
  
  <p><a href="https://stackoverflow.com/questions/50724915/is-it-possible-to-have-multiple-dataproviders-in-react-admin">Is it possible to have multiple dataProviders in react-admin?</a></p>