diff --git a/src/components/App/index.js b/src/components/App/index.js index de2459c..b131888 100644 --- a/src/components/App/index.js +++ b/src/components/App/index.js @@ -58,7 +58,7 @@ class App extends React.PureComponent { try { const Render = await import( /* webpackChunkName: "render-[index]" */ - 'components/Render' // TODO: Import syntax-specific render component + `syntax/${ syntax }` ); // HACK: Fake loading time @@ -115,7 +115,6 @@ class App extends React.PureComponent { }; const renderProps = { onRender: this.handleSvg, - syntax, expr }; diff --git a/src/components/Render/index.js b/src/components/Render/index.js index d531580..3785003 100644 --- a/src/components/Render/index.js +++ b/src/components/Render/index.js @@ -30,9 +30,10 @@ class Render extends React.PureComponent { } render() { - const { syntax, expr } = this.props; + const { expr } = this.props; - console.log('Render:', syntax, expr); // eslint-disable-line no-console + // eslint-disable-next-line no-console + console.log('Render:', this.constructor.name, expr); // Demo rendering for now return
@@ -42,7 +43,6 @@ class Render extends React.PureComponent { } Render.propTypes = { - syntax: PropTypes.string, expr: PropTypes.string, onRender: PropTypes.func.isRequired }; diff --git a/src/syntax/js.js b/src/syntax/js.js new file mode 100644 index 0000000..aefec9a --- /dev/null +++ b/src/syntax/js.js @@ -0,0 +1,5 @@ +import Render from 'components/Render'; + +class RenderJS extends Render {} + +export default RenderJS; diff --git a/src/syntax/pcre.js b/src/syntax/pcre.js new file mode 100644 index 0000000..11c32d9 --- /dev/null +++ b/src/syntax/pcre.js @@ -0,0 +1,5 @@ +import Render from 'components/Render'; + +class RenderPCRE extends Render {} + +export default RenderPCRE;