sudo apt install zsh-autosuggestions zsh-syntax-highlighting zsh
| // HOC版本 | |
| const withDelayHint = (loadingPropName, delay) => ComponentIn => class extends Component { | |
| state = { | |
| timer: null, | |
| isDelayed: false | |
| }; | |
| tryStartTimer = () => { | |
| clearTimeout(this.state.timer); |
| // Example using create-react-app. | |
| // For scratch configurations, add babel-plugin-transform-class-properties. | |
| // More info: https://babeljs.io/docs/plugins/transform-class-properties/ | |
| import React from 'react' | |
| class Example extends React.Component { | |
| example = (param) => () => { | |
| console.log('Hello ', param) | |
| } |
| import React from 'react'; | |
| import { reduxForm, Field } from 'redux-form'; | |
| import { ScrollView, Text, TouchableOpacity } from 'react-native'; | |
| import moment from 'moment'; | |
| import MyTextInput from './MyTextInput'; | |
| /** | |
| * Automatically adds the dashes required by the specified phone format and limits the input to ten characters | |
| */ |
| import * as React from 'react'; | |
| import { Component } from 'react'; | |
| export default function HOCBaseRender<Props, State, ComponentState>( | |
| Comp: new() => Component<Props & State, ComponentState>) { | |
| return class HOCBase extends Component<Props, State> { | |
| render() { | |
| return <Comp {...this.props} {...this.state}/>; | |
| } | |
| } |
| var Col = require('react-bootstrap/lib/Col') | |
| var PageHeader = require('react-bootstrap/lib/PageHeader') | |
| var React = require('react') | |
| var Row = require('react-bootstrap/lib/Row') | |
| var {connect} = require('react-redux') | |
| var {reduxForm} = require('redux-form') | |
| var DateInput = require('./DateInput') | |
| var FormField = require('./FormField') | |
| var LoadingButton = require('./LoadingButton') |
| var data = [ | |
| { | |
| "text": "Link 1", | |
| "url": "#" | |
| }, | |
| { | |
| "text": "Link 2", | |
| "url": "#" | |
| }, | |
| { |
(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.