Skip to content

Commit 06f794e

Browse files
committed
Fix up the build with the new version of Webpack
1 parent b9ce4a5 commit 06f794e

40 files changed

+1674
-95
lines changed

app/Homepage.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
title: Markdown Component Loader
33
---
44
<center>
5-
<h1><img id="logo" src={require('./images/logo.svg')} alt="Markdown Component Loader" /></h1>
5+
<h1><img id="logo" src={require('./images/logo.svg').default} alt="Markdown Component Loader" /></h1>
66

77
A Webpack loader that turns Markdown into dynamic, stateless React components!
88

app/repl.js

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import React from 'react';
22
import ReactDOM from 'react-dom';
33
import DocChomp from 'doc-chomp';
4-
import Codemirror from 'react-codemirror2';
4+
import { Controlled as Codemirror } from 'react-codemirror2';
55

66
import 'codemirror/lib/codemirror.css';
77
import 'codemirror/mode/markdown/markdown';
@@ -50,18 +50,18 @@ class REPL extends React.Component {
5050
error: 'Not yet compiled...'
5151
};
5252

53-
this.handleEditorChange = this.handleEditorChange.bind(this);
53+
this.handleEditorBeforeChange = this.handleEditorBeforeChange.bind(this);
5454
}
5555

56-
componentWillMount() {
56+
UNSAFE_componentWillMount() {
5757
this.compile(this.state.input);
5858
}
5959

6060
render() {
6161
return (
6262
<div className="repl">
6363
<div className="header">
64-
<img id="logo" src={require('./images/logo.svg')} alt="Markdown Component Loader" />
64+
<img id="logo" src={require('./images/logo.svg').default} alt="Markdown Component Loader" />
6565
<a className="bubble-link blue-bubble" href="index.html">Learn more</a>
6666
</div>
6767
<div className="repl-editors">
@@ -72,7 +72,7 @@ class REPL extends React.Component {
7272
...COMMON_CODEMIRROR_OPTIONS
7373
}}
7474
value={this.state.input}
75-
onChange={this.handleEditorChange}
75+
onBeforeChange={this.handleEditorBeforeChange}
7676
/>
7777
<Codemirror
7878
className="repl-editor repl-output"
@@ -95,7 +95,7 @@ class REPL extends React.Component {
9595
);
9696
}
9797

98-
handleEditorChange(editor, metadata, input) {
98+
handleEditorBeforeChange(editor, metadata, input) {
9999
this.setState({ input }, () => {
100100
this.compile(input);
101101
});
@@ -121,6 +121,8 @@ class REPL extends React.Component {
121121
}
122122
}
123123

124+
console.debug(REPL, Codemirror);
125+
124126
ReactDOM.render(
125127
<REPL />,
126128
document.getElementById('root')
Lines changed: 1 addition & 0 deletions
Loading

docs/1e7ea3e8ac242d69c669bb535d4bdcf1.svg

Lines changed: 0 additions & 1 deletion
This file was deleted.
Lines changed: 1 addition & 0 deletions
Loading
134 KB
Loading

0 commit comments

Comments
 (0)