Skip to content

Commit 38e81e5

Browse files
committed
fixed Module has no exported member Hello
1 parent 13e5163 commit 38e81e5

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

doc/handbook/quick-start/react-webpack.md

+3-7
Original file line numberDiff line numberDiff line change
@@ -99,16 +99,12 @@ typings install --ambient --save react-dom
9999
import * as React from "react";
100100
import * as ReactDOM from "react-dom";
101101

102-
class HelloComponent extends React.Component<any, any> {
102+
export class HelloComponent extends React.Component<any, any> {
103103
render() {
104104
return <h1>Hello from {this.props.compiler} and {this.props.framework}!</h1>;
105105
}
106106
}
107107

108-
ReactDOM.render(
109-
<HelloComponent />,
110-
document.getElementById("example")
111-
);
112108
```
113109

114110
注意一点这个例子已经很像类了,我们不再需要使用类。
@@ -120,10 +116,10 @@ ReactDOM.render(
120116
import * as React from "react";
121117
import * as ReactDOM from "react-dom";
122118

123-
import { Hello } from "./components/Hello";
119+
import { HelloComponent } from "./components/Hello";
124120

125121
ReactDOM.render(
126-
<Hello compiler="TypeScript" framework="React" />,
122+
<HelloComponent compiler="TypeScript" framework="React" />,
127123
document.getElementById("example")
128124
);
129125
```

0 commit comments

Comments
 (0)