File tree Expand file tree Collapse file tree 1 file changed +4
-7
lines changed Expand file tree Collapse file tree 1 file changed +4
-7
lines changed Original file line number Diff line number Diff line change @@ -66,10 +66,10 @@ const DemoRender = (): JSX.Element => {
66
66
}
67
67
if ( elementType === 'input' ) componentsToRender . push ( < Box component = { elementType } className = { classRender } style = { elementStyle } key = { key } id = { `rend${ childId } ` } > </ Box > ) ;
68
68
else if ( elementType === 'img' ) componentsToRender . push ( < Box component = { elementType } src = { activeLink } className = { classRender } style = { elementStyle } key = { key } id = { `rend${ childId } ` } > </ Box > ) ;
69
- else if ( elementType === 'a' || elementType === 'Link' ) componentsToRender . push ( < Box component = { 'a' } href = { activeLink } className = { classRender } style = { elementStyle } key = { key } id = { `rend${ childId } ` } > { innerText } </ Box > ) ;
69
+ else if ( elementType === 'a' ) componentsToRender . push ( < Box component = { elementType } href = 'javascript:void(0)' className = { classRender } style = { elementStyle } key = { key } id = { `rend${ childId } ` } > { innerText } </ Box > ) ;
70
70
else if ( elementType === 'Switch' ) componentsToRender . push ( < Switch > { renderedChildren } </ Switch > ) ;
71
71
else if ( elementType === 'Route' ) componentsToRender . push ( < Route exact path = { activeLink } > { renderedChildren } </ Route > ) ;
72
- // else if (elementType === 'LinkTo ') componentsToRender.push(<Link to={activeLink}>{innerText}</Link>);
72
+ else if ( elementType === 'Link ' ) componentsToRender . push ( < Box component = 'a' href = 'javascript:void(0)' className = { classRender } style = { elementStyle } key = { key } id = { `rend ${ childId } ` } > { innerText } </ Box > ) /*componentsToRender.push(< Link to={activeLink}>{innerText}</Link>);*/
73
73
else componentsToRender . push ( < Box component = { elementType } className = { classRender } style = { elementStyle } key = { key } id = { `rend${ childId } ` } > { innerText } { renderedChildren } </ Box > ) ;
74
74
key += 1 ;
75
75
}
@@ -78,12 +78,9 @@ const DemoRender = (): JSX.Element => {
78
78
} ;
79
79
80
80
let code = '' ;
81
- const currComponent = state . components . filter ( element => element . id === state . canvasFocus . componentId ) ;
82
- componentBuilder ( currComponent [ 0 ] . children ) . forEach ( element => {
81
+ const currComponent = state . components . find ( element => element . id === state . canvasFocus . componentId ) ;
82
+ componentBuilder ( currComponent . children ) . forEach ( element => {
83
83
try {
84
- if ( element . props . component === 'Link' ) {
85
-
86
- }
87
84
code += ReactDOMServer . renderToString ( element )
88
85
} catch {
89
86
return ;
You can’t perform that action at this time.
0 commit comments