This file contains hidden or 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
| // MyButton.jsx | |
| function MyButton(props) { | |
| return <button onClick={props.onButtonClick}>{props.buttonTitle}</button>; | |
| } | |
| export default MyButton; | |
| // MyComponent.jsx |
This file contains hidden or 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
| // Message.jsx | |
| export default class Message extends Component { | |
| render: function() { | |
| return <p>{this.props.children}</p> | |
| } | |
| } | |
| // MyComponent.jsx | |
| // import Message from "Message" |
This file contains hidden or 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
| // MyButton.jsx | |
| function MyButton() { | |
| return <button>Click me!</button>; | |
| } | |
| export default MyButton; |
This file contains hidden or 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
| // MyButton.jsx | |
| export default class MyButton extends Component { | |
| render() { | |
| return <button>Click me!</button> | |
| } | |
| } | |
| // MyComponent.jsx | |
| // import MyButton from "MyButton" |
This file contains hidden or 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 { render } from 'react-dom'; | |
| export class MyComponent extends Component { | |
| render() { | |
| return ( | |
| <div className="my-div">My div content</div> | |
| ); | |
| } | |
| } |
This file contains hidden or 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
| //npm install express | |
| var express = require('express'); | |
| var app = express(); | |
| var http = require('http'); | |
| app.use(function(req, res, next) { | |
| res.header("Access-Control-Allow-Origin", "*"); | |
| res.header("Access-Control-Allow-Headers", "Origin, X-Requested-With, Content-Type, Accept"); | |
| next(); |
NewerOlder