Allow client components to export React components from index.js
Currently PubSweet components have to export an object, e.g.
module.exports = {
frontend: {
components: [
() => require('./components/Dashboard')
]
}
}
Unfortunately this means that client apps have to import components from within the module (e.g. import Dashboard from 'pubsweet-component-dashboard/src/components/Dashboard'
, which is fragile.
Where each component represents a page, the default export of the component would ideally be the React component that would be used in the app's route mapping for that page.