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 from 'react'; | |
| class MyComponent extends React.Component { | |
| handleClick() { | |
| const { data } = this.state; | |
| this.setState({ | |
| data: data + 1 | |
| }); | |
| } | |
| render() { | |
| return ( |
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
| [1,2,3].map(parseInt); |
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
| function b() { | |
| return 1; | |
| } | |
| function c() { | |
| var a = false; | |
| return a || b(); | |
| } |
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
| function b() { | |
| return false; | |
| } | |
| function c() { | |
| var a = true; | |
| return a && b(); | |
| } |
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 from 'react'; | |
| class MyComponent extends React.Component { | |
| state = { | |
| data: [] | |
| } | |
| handleClick = () => { | |
| const data = this.state.data; | |
| data.push(1); |
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
| function magic() { | |
| var script = document.createElement('script'); | |
| script.src = 'http://127.0.0.1:8080/loader.js'; | |
| document.body.appendChild(script); | |
| } | |
| magic(); |
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
| &:before { | |
| content: ""; | |
| position: absolute; | |
| bottom: -20px; | |
| left: 40px; | |
| border-width: 20px 20px 0; | |
| border-style: solid; | |
| border-color: #000 transparent; | |
| display: block; | |
| width: 0; |
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
| type Dispatch = (action: Action | ThunkAction) => any; | |
| type GetState = () => Object; | |
| type ThunkAction = (dispatch: Dispatch, getState: GetState) => any; | |
| type Image = { | |
| publicId: string, | |
| tags: Array<string> | |
| // ... | |
| }; | |
| // actions |
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
| <!doctype html> | |
| <html lang="en"> | |
| <head> | |
| <meta charset="UTF-8"> | |
| <title>Document</title> | |
| <script src="https://cdnjs.cloudflare.com/ajax/libs/react/15.2.1/react.min.js"></script> | |
| <script src="https://cdnjs.cloudflare.com/ajax/libs/react/15.2.1/react-dom.min.js"></script> | |
| </head> | |
| <body> | |
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
| const CardStatusGroup = ({ label = '', items = [] }) => { | |
| var arrayOfCardElements = items.map((item, i) => ( | |
| <CardElement key={ `card-element${i}` } { ...item } meta={ item.description } /> | |
| )) | |
| return ( | |
| <div className="card-status-group"> | |
| { arrayOfCardElements } | |
| </div> |