Using appContext in DataSourceWrapper and createRoutes

This commit is contained in:
dannyrb committed 2020-05-17 22:18:25 -04:00
1 parent c2853f719a
commit 70ad940941
6 files changed
+31 -34

No files matched your search

@@ -1,9 +1,10 @@
/* eslint-disable react/jsx-props-no-spreading */
import React, { useEffect, useState } from 'react';
import React, { useContext, useEffect, useState } from 'react';
import PropTypes from 'prop-types';
import { MODULE_TYPES } from '@ohif/core';
//
import { appConfig, extensionManager } from '../App.jsx';
import { appConfigContext } from '../state/appConfig.context';
import { extensionManager } from '../App.jsx';
/**
* Uses route properties to determine the data source that should be passed
@@ -14,6 +15,7 @@ import { appConfig, extensionManager } from '../App.jsx';
* @param {function} props.children - Layout Template React Component
*/
function DataSourceWrapper(props) {
const { appConfig } = useContext(appConfigContext);
const { children: LayoutTemplate, history, ...rest } = props;
const queryFilterValues = _getQueryFilterValues(history.location.search);