Guest User

Untitled

a guest
Dec 11th, 2018
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.59 KB | None | 0 0
  1. {
  2. "react statefull component": {
  3. "prefix": "react-native-statefull",
  4. "body": [
  5. "import React from 'react';",
  6. "import {View, StyleSheet} from 'react-native';",
  7. "",
  8. "type Props = {",
  9. "",
  10. "};",
  11. "",
  12. "export default class ${1:Component} extends React.PureComponent<Props> {",
  13. " public render() {",
  14. " return (",
  15. " <View style={styles.container}>",
  16. " {/**/}",
  17. " </View>",
  18. " );",
  19. " }",
  20. "",
  21. "}",
  22. "",
  23. "const styles = StyleSheet.create({",
  24. " container: {",
  25. "",
  26. " },",
  27. "});",
  28. ""
  29. ]
  30. },
  31. "react statefull connected component": {
  32. "prefix": "react-native-statefull-connected",
  33. "body": [
  34. "import React from 'react';",
  35. "import {View, StyleSheet} from 'react-native';",
  36. "import {connect} from 'react-redux';",
  37. "import {AppState} from 'types/types-redux';",
  38. "",
  39. "type Props = {",
  40. "",
  41. "};",
  42. "",
  43. "class ${1:Component} extends React.PureComponent<Props> {",
  44. " public render() {",
  45. " return (",
  46. " <View style={styles.container}>",
  47. " {/**/}",
  48. " </View>",
  49. " );",
  50. " }",
  51. "",
  52. "}",
  53. "",
  54. "const styles = StyleSheet.create({",
  55. " container: {",
  56. "",
  57. " },",
  58. "});",
  59. "export default connect((state: AppState) => ({",
  60. "",
  61. "}))(${1:Component});",
  62. ]
  63. },
  64. "react stateless component": {
  65. "prefix": "react-native-stateless",
  66. "body": [
  67. "import React from 'react';",
  68. "import {View, StyleSheet} from 'react-native';",
  69. "",
  70. "type Props = {",
  71. "",
  72. "};",
  73. "",
  74. "export default function ${1:Component}({}: Props) {",
  75. " return (",
  76. " <View style={styles.container}>",
  77. " {/**/}",
  78. " </View>",
  79. " );",
  80. "}",
  81. "",
  82. "const styles = StyleSheet.create({",
  83. " container: {",
  84. "",
  85. " },",
  86. "});",
  87. "",
  88. ]
  89. },
  90. "react connected stateless comp": {
  91. "prefix": "react-native-connected-stateless",
  92. "body": [
  93. "import React from 'react';",
  94. "import {View, StyleSheet, Button} from 'react-native';",
  95. "import {connect} from 'react-redux';",
  96. "import {AppState} from 'types/types-redux';",
  97. "",
  98. "type Props = {",
  99. "",
  100. "};",
  101. "",
  102. "function ${1:Component}({}: Props) {",
  103. " return (",
  104. " <View style={styles.container}>",
  105. " {/**/}",
  106. " </View>",
  107. " );",
  108. "}",
  109. "",
  110. "const styles = StyleSheet.create({",
  111. " container: {",
  112. "",
  113. " },",
  114. "});",
  115. "",
  116. "export default connect((state: AppState) => ({",
  117. "",
  118. "}))(${1:Component});",
  119.  
  120. ]
  121. }
  122. }
Add Comment
Please, Sign In to add comment