@talend/react-cmf
Version:
A framework built on top of best react libraries
47 lines (46 loc) • 1.31 kB
JavaScript
/**
* Internal module, you should not use it directly
* @module react-cmf/lib/App
*/
import PropTypes from 'prop-types';
import { Provider } from 'react-redux';
import RegistryProvider from './RegistryProvider';
import { WaitForSettings } from './settings';
import ErrorBoundary from './components/ErrorBoundary/ErrorBoundary.component';
/**
* The React component that render your app and provide CMF environment.
* @param {object} props { store }
* @return {object} ReactElement
*/
import { jsx as _jsx } from "react/jsx-runtime";
export default function App(props) {
let content = props.children;
if (props.withSettings) {
content = /*#__PURE__*/_jsx(WaitForSettings, {
loading: props.loading,
children: content
});
}
return /*#__PURE__*/_jsx(Provider, {
store: props.store,
children: /*#__PURE__*/_jsx(RegistryProvider, {
value: props.registry,
children: /*#__PURE__*/_jsx(ErrorBoundary, {
fullPage: true,
children: content
})
})
});
}
App.displayName = 'CMFApp';
App.propTypes = {
store: PropTypes.object.isRequired,
registry: PropTypes.object,
children: PropTypes.node,
withSettings: PropTypes.bool,
loading: PropTypes.func
};
App.defaultProps = {
loading: () => 'loading'
};
//# sourceMappingURL=App.js.map