@carbonorm/carbonreact 4.0.17 → 4.0.19
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs.js +2 -2
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +3 -3
- package/dist/index.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/CarbonReact.tsx +4 -4
package/package.json
CHANGED
package/src/CarbonReact.tsx
CHANGED
|
@@ -10,7 +10,7 @@ import {initialRestfulObjectsState, iRestfulObjectArrayTypes} from "variables/C6
|
|
|
10
10
|
import CarbonWebSocket, {iCarbonWebSocketProps} from "./components/WebSocket/CarbonWebSocket";
|
|
11
11
|
import updateRestfulObjectArrays, {iUpdateRestfulObjectArrays} from "./hoc/updateRestfulObjectArrays";
|
|
12
12
|
import deleteRestfulObjectArrays, {iDeleteRestfulObjectArrays} from "./hoc/deleteRestfulObjectArrays";
|
|
13
|
-
import {BrowserRouter, HashRouter, MemoryRouter
|
|
13
|
+
import {BrowserRouter, HashRouter, MemoryRouter} from "react-router-dom";
|
|
14
14
|
|
|
15
15
|
export type tStatefulApiData<T extends { [key: string]: any } = {}> = T[] | undefined | null;
|
|
16
16
|
|
|
@@ -168,7 +168,7 @@ abstract class CarbonReact<P = {}, S extends iCarbonReactState = iCarbonReactSta
|
|
|
168
168
|
}
|
|
169
169
|
|
|
170
170
|
reactRouterContext(children: ReactElement) {
|
|
171
|
-
switch (this.props.routerType) {
|
|
171
|
+
switch (this.props.routerType ?? eRouterType.BrowserRouter) {
|
|
172
172
|
case eRouterType.BrowserRouter:
|
|
173
173
|
return <BrowserRouter>{children}</BrowserRouter>
|
|
174
174
|
case eRouterType.MemoryRouter:
|
|
@@ -199,7 +199,7 @@ abstract class CarbonReact<P = {}, S extends iCarbonReactState = iCarbonReactSta
|
|
|
199
199
|
this.context = createContext(this.state)
|
|
200
200
|
const Context = this.context.Provider;
|
|
201
201
|
|
|
202
|
-
return this.reactRouterContext(
|
|
202
|
+
return this.reactRouterContext(<>
|
|
203
203
|
<GlobalHistory/>
|
|
204
204
|
{this.props.websocket &&
|
|
205
205
|
<CarbonWebSocket<P, S> {...(false !== this.props.websocket ? this.props.websocket : {})}
|
|
@@ -208,7 +208,7 @@ abstract class CarbonReact<P = {}, S extends iCarbonReactState = iCarbonReactSta
|
|
|
208
208
|
{this.props.children}
|
|
209
209
|
</Context>
|
|
210
210
|
<ToastContainer/>
|
|
211
|
-
|
|
211
|
+
</>);
|
|
212
212
|
}
|
|
213
213
|
}
|
|
214
214
|
|