This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { Component } from ‘react’; | |
class App extends Component { | |
render() { | |
return ( | |
<div className=”App”> | |
<h1>Hello React!</h1> | |
</div> | |
); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react'; | |
import ReactDOM from 'react-dom'; | |
import './index.css'; | |
import App from './App'; | |
import { createStore } from 'redux'; | |
import { Provider } from 'react-redux'; | |
import postReducer from './reducers/postReducer'; | |
const store = createStore(postReducer); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
body { | |
margin: 0; | |
padding: 0; | |
font-family: 'Work Sans',sans-serif; | |
background:#f4f4ef; | |
} | |
.center { | |
text-align: center; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { Component } from 'react'; | |
import PostForm from './PostForm'; | |
import AllPost from './AllPost'; | |
class App extends Component { | |
render() { | |
return ( | |
<div className="App"> | |
<div className="navbar"> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { Component } from 'react'; | |
import { connect } from 'react-redux'; | |
class PostForm extends Component { | |
handleSubmit = (e) => { | |
e.preventDefault(); | |
const title = this.getTitle.value; | |
const message = this.getMessage.value; | |
const data = { | |
id: new Date(), | |
title, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { Component } from 'react'; | |
import { connect } from 'react-redux'; | |
class Post extends Component { | |
render() { | |
return ( | |
<div className="post"> | |
<h2 className="post_title">{this.props.post.title}</h2> | |
<p className="post_message">{this.props.post.message}</p> | |
<div className="control-buttons"> | |
<button className="edit" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { Component } from 'react'; | |
import { connect } from 'react-redux'; | |
import Post from './Post'; | |
import EditComponent from './EditComponent'; | |
class AllPost extends Component { | |
render() { | |
return ( | |
<div> | |
<h1 className="post_heading">All Posts</h1> | |
{this.props.posts.map((post) => ( |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { Component } from 'react'; | |
import { connect } from 'react-redux'; | |
class EditComponent extends Component { | |
handleEdit = (e) => { | |
e.preventDefault(); | |
const newTitle = this.getTitle.value; | |
const newMessage = this.getMessage.value; | |
const data = { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
asdasdasd |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react'; | |
import ReactDOM from 'react-dom'; | |
import './index.css'; | |
import App from './App'; | |
ReactDOM.render( | |
<App />,document.getElementById('root')); |
OlderNewer