diff --git a/vim/UltiSnips/javascript.snippets b/vim/UltiSnips/javascript.snippets index 2d00894..d0f99bd 100644 --- a/vim/UltiSnips/javascript.snippets +++ b/vim/UltiSnips/javascript.snippets @@ -1,3 +1,26 @@ +snippet reactConnectedRoute "React template" b +import React from 'react' +import { connect } from 'react-redux' +import { isLogin } from 'utils/self' +import { Redirect, Route } from 'react-router-dom' + +export default connect((state, ownProps) => { + const { self } = state + return { self } +})(({ component: Component, ...rest }) => { + const { self } = rest + return isLogin(self) ? : + } + /> +}) +endsnippet + snippet reactComponent "React template" b import React, { Component } from 'react'