Commit 5de72ffb authored by Jeff Avallone's avatar Jeff Avallone

Loading syntax-specific rendering module

Still mocked out for testing
parent c3116bf5
......@@ -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
};
......
......@@ -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 <div className={ style.render } ref={ this.svgContainer }>
......@@ -42,7 +43,6 @@ class Render extends React.PureComponent {
}
Render.propTypes = {
syntax: PropTypes.string,
expr: PropTypes.string,
onRender: PropTypes.func.isRequired
};
......
import Render from 'components/Render';
class RenderJS extends Render {}
export default RenderJS;
import Render from 'components/Render';
class RenderPCRE extends Render {}
export default RenderPCRE;
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment