text 用于vim和ultisnip的React Native代码段

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了text 用于vim和ultisnip的React Native代码段相关的知识,希望对你有一定的参考价值。

snippet rnccf
import React, { PropTypes } from 'react'
import { View, StyleSheet, Text } from 'react-native'

$1.propTypes = {

}

export default function ${1:FunctionName} (props) {
  return (
    <View>
      <Text>
       $1
      </Text>
    </View>
  )
}

const styles = StyleSheet.create({
	$0

})

endsnippet


snippet rnccs
import React, { PropTypes, Component } from 'react'
import { View, Text } from 'react-native'

export default class ${1:ClassName} extends Component {
  static propTypes = {}
  state = {}
  render () {
    return (
      ${0:<View>
        <Text>
          $1
        </Text>
      </View>}
    )
  }
}
endsnippet

snippet duck
const initialState = {}

export default function ${1:FunctionName} (state = initialState, action) {
  switch (action.type) {
    default :
      return state
  }
}
endsnippet

snippet imcon
import { connect } from 'react-redux'
$0
endsnippet

snippet statprop
static propTypes = {
	$0
}
endsnippet

snippet mapsta
function mapStateToProps ({${1:reducerName}}) {
	return {
		$1
	}
}
endsnippet

snippet mapdis
function mapDispatchToProps (dispatch) {
	return {
		$1	
	}
}
endsnippet

snippet expcon
export default connect(
	mapStateToProps
)(
	${1:FileName}
)
endsnippet

snippet imfun
import {$1} from '$2'
endsnippet

snippet imcla
import $1 from '$2'
endsnippet

以上是关于text 用于vim和ultisnip的React Native代码段的主要内容,如果未能解决你的问题,请参考以下文章

vim代码片段插件ultisnips的使用

VIM 代码片段插件 ultisnips 使用教程

vim插件-Ultisnips

Vim 自定义补全利器 Snippet

latex在vim中的代码片段

用于 TypeScript React 开发的 NeoVim