You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+21Lines changed: 21 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -450,6 +450,27 @@ class Button extends Component {
450
450
export default Button;
451
451
```
452
452
453
+
7. Finally, let's open our ```App.js``` file in the /src directory to add our new Button Component to the App itself. Check below to see the example. Don't forget that we need to enclose the ```<Button />```in two ```<div></div>``` tags!
454
+
```javascript
455
+
import React, { Component } from 'react';
456
+
import logo from './logo.svg';
457
+
import './App.css';
458
+
459
+
import Button from './components/Button';
460
+
461
+
class App extends Component {
462
+
render() {
463
+
return (
464
+
<div>
465
+
<Button />
466
+
</div>
467
+
);
468
+
}
469
+
}
470
+
471
+
export default App;
472
+
```
473
+
453
474
This should be everything we need to setup the API. Simply click our test api call button and see the magic work!
454
475
455
476
Congratulations! Our Rails API and React Client is done!
0 commit comments