Advertisement
Guest User

Untitled

a guest
Sep 18th, 2019
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.77 KB | None | 0 0
  1. renderComponent: function(component, history, dynamicallyLoaded) {
  2.  
  3. if (component == null) return <React.Fragment/>;
  4.  
  5. if (Array.isArray(component)) {
  6. return component.map(x => this.renderComponent(x, history));
  7. }
  8.  
  9. var existingComponent = this.components.find(x => x.type === component.type);
  10. if (existingComponent != null) {
  11. return React.createElement(existingComponent.component, {
  12. ...component,
  13. key: component.id,
  14. history
  15. });
  16. } else if (component.isPlugin && !dynamicallyLoaded) {
  17. return <LazyElement component={component} key={component.id} history={history}/>
  18. }
  19.  
  20. return internalRenderComponent(component, history);
  21. },
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement