mirror of
https://github.com/microsoft/frontend-bootcamp.git
synced 2026-01-26 14:56:42 +08:00
Step1/04 - React Intro - final demo - fix to show the customized buttons (#131)
* Fix Step1/04 - React Intro - final Problem: 1. Customized Button.tsx is not used in Counter.tsx 2. index.tsx still renders the 'hello world' text Fix: 1. Use customized Button.tsx in Counter.tsx 2. Have index.tsx render the App component instead of 'hello world' text Notes: Validated customized button now show correctly. * Add missing blank line.
This commit is contained in:
@@ -1,4 +1,5 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
|
import { Button } from './Button';
|
||||||
|
|
||||||
export class Counter extends React.Component<any, any> {
|
export class Counter extends React.Component<any, any> {
|
||||||
constructor(props) {
|
constructor(props) {
|
||||||
@@ -13,7 +14,7 @@ export class Counter extends React.Component<any, any> {
|
|||||||
return (
|
return (
|
||||||
<div>
|
<div>
|
||||||
{text}: {clicks}
|
{text}: {clicks}
|
||||||
<button onClick={this._onButtonClick}>Click</button>
|
<Button onClick={this._onButtonClick}>Click</Button>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import ReactDOM from 'react-dom';
|
import ReactDOM from 'react-dom';
|
||||||
|
import { App } from './App';
|
||||||
|
|
||||||
ReactDOM.render(<p>hello world </p>, document.getElementById('app'));
|
ReactDOM.render(<App />, document.getElementById('app'));
|
||||||
|
|||||||
Reference in New Issue
Block a user