MCPcopy Create free account
hub / github.com/react-dnd/react-dnd / render

Method render

site/components/StaticHTMLBlock.js:10–49  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

8 };
9
10 render() {
11 const { html } = this.props;
12
13 // Here goes a really hack-ish way to convert
14 // areas separated by Markdown <hr>s into code tabs.
15
16 const blocks = html.split('<hr/>');
17 const elements = [];
18
19 let es5Content = null;
20 let es6Content = null;
21 let es7Content = null;
22
23 for (let i = 0; i < blocks.length; i++) {
24 const content = blocks[i];
25
26 switch (i % 4) {
27 case 0:
28 elements.push(
29 <div key={i}
30 style={{ width: '100%' }}
31 dangerouslySetInnerHTML={{__html: content}} />
32 );
33 break;
34 case 1:
35 es5Content = content;
36 break;
37 case 2:
38 es6Content = content;
39 break;
40 case 3:
41 es7Content = content;
42 elements.push(
43 <CodeBlock key={i}
44 es5={es5Content}
45 es6={es6Content}
46 es7={es7Content} />
47 );
48 break;
49 }
50 }
51
52 return (

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected