@@ -2,7 +2,7 @@ import React from 'react';
22import PropTypes from 'prop-types' ;
33
44
5- const ExternalComponent = ( { id, text, input_id } ) => {
5+ const ExternalComponent = ( { id, text, input_id, extra_component } ) => {
66 const ctx = window . dash_component_api . useDashContext ( ) ;
77 const ExternalWrapper = window . dash_component_api . ExternalWrapper ;
88
@@ -15,6 +15,14 @@ const ExternalComponent = ({ id, text, input_id }) => {
1515 value = { text }
1616 componentPath = { [ ...ctx . componentPath , 'external' ] }
1717 />
18+ {
19+ extra_component &&
20+ < ExternalWrapper
21+ componentType = { extra_component . type }
22+ componentNamespace = { extra_component . namespace }
23+ componentPath = { [ ...ctx . componentPath , 'extra' ] }
24+ { ...extra_component . props }
25+ /> }
1826 </ div >
1927 )
2028}
@@ -23,6 +31,11 @@ ExternalComponent.propTypes = {
2331 id : PropTypes . string ,
2432 text : PropTypes . string ,
2533 input_id : PropTypes . string ,
34+ extra_component : PropTypes . exact ( {
35+ type : PropTypes . string ,
36+ namespace : PropTypes . string ,
37+ props : PropTypes . object ,
38+ } ) ,
2639} ;
2740
2841export default ExternalComponent ;
0 commit comments