mirror of
https://github.com/vale981/Vulcan
synced 2025-03-05 17:41:43 -05:00
Fix replaceComponent
This commit is contained in:
parent
5fc0e30f40
commit
43515b39bb
1 changed files with 4 additions and 2 deletions
|
@ -107,12 +107,14 @@ export const populateComponentsApp = () => {
|
|||
* an empty array, and it's ok!
|
||||
* See https://github.com/reactjs/redux/blob/master/src/compose.js#L13-L15
|
||||
*/
|
||||
export const replaceComponent = (name, newComponent, ...newHocs) => {
|
||||
export function replaceComponent(name, newComponent, ...newHocs) {
|
||||
|
||||
// support single argument syntax
|
||||
if (typeof arguments[0] === 'object') {
|
||||
const { name, component, hocs = [] } = arguments[0];
|
||||
// eslint-disable-next-line no-redeclare
|
||||
var { name, component, hocs = [] } = arguments[0];
|
||||
newComponent = component;
|
||||
newHocs = hocs;
|
||||
}
|
||||
|
||||
const previousComponent = ComponentsTable[name];
|
||||
|
|
Loading…
Add table
Reference in a new issue