javascript - Pushing indents before and after main body in typescript? -
i'm using react , typescript, trying this:
let indents: jsx.element[] = []; indents.push(<div>); (var = 0; < 10; i++) { indents.push(<div>testing</div>); } indents.push(</div>);
when indents.push(); top error on loop.
my aim create opening , closing tags @ top level add bunch of nested tags before closing top level tag.
you need thing this:
let indents: jsx.element[] = []; (var = 0; < 10; i++) { indents.push(<div>testing</div>); } return ( <div> {indents} </div> );
at return statement have create react element <div>
have children indents
.
Comments
Post a Comment