File tree Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -36,6 +36,15 @@ const DemoRender = (props): JSX.Element => {
36
36
renderedChildren = componentBuilder ( element . children ) ;
37
37
}
38
38
// check if array was used -> write a forEach / for
39
+ if ( Array . isArray ( innerText ) ) {
40
+ innerText . forEach ( el => {
41
+ const elementCopy = JSON . parse ( JSON . stringify ( element ) ) ;
42
+ elementCopy . attributes . compText = el ;
43
+ componentsToRender . push ( componentBuilder ( [ elementCopy ] , key ++ ) ) ;
44
+ } ) ;
45
+ continue ;
46
+ }
47
+
39
48
if ( elementType === 'input' ) componentsToRender . push ( < Box component = { elementType } className = { classRender } style = { elementStyle } key = { key } id = { `rend${ childId } ` } > </ Box > ) ;
40
49
else if ( elementType === 'img' ) componentsToRender . push ( < Box component = { elementType } src = { activeLink } className = { classRender } style = { elementStyle } key = { key } id = { `rend${ childId } ` } > </ Box > ) ;
41
50
else if ( elementType === 'a' ) componentsToRender . push ( < Box component = { elementType } href = { activeLink } className = { classRender } style = { elementStyle } key = { key } id = { `rend${ childId } ` } > { innerText } </ Box > ) ;
You can’t perform that action at this time.
0 commit comments