react-native-component
Advanced tools
| import React, { Component } from 'react'; | ||
| import { View, Text } from 'react-native'; | ||
| import styles from './styles'; | ||
| class GenericComponent extends Component { | ||
| render() { | ||
| return ( | ||
| <View style={styles.container}> | ||
| <Text>GenericComponent!</Text> | ||
| </View> | ||
| ); | ||
| } | ||
| } | ||
| GenericComponent.propTypes = { | ||
| }; | ||
| export default GenericComponent; |
| import React from 'react'; | ||
| import { View, Text } from 'react-native'; | ||
| import styles from './styles'; | ||
| const GenericComponent = () => ( | ||
| <View style={styles.container}> | ||
| <Text>GenericComponent!</Text> | ||
| </View> | ||
| ); | ||
| GenericComponent.propTypes = { | ||
| }; | ||
| export default GenericComponent; |
| import { StyleSheet } from 'react-native'; | ||
| const styles = StyleSheet.create({ | ||
| container: { flex: 1 } | ||
| }); | ||
| export default styles; |
| const path = require('path'); | ||
| const { copyFile, removeFile, replaceFile } = require('./utils'); | ||
| const GENERIC_STATELESS_COMPONENT_PATH = 'lib/GenericStatelessComponent'; | ||
| const GENERIC_STATELESS_COMPONENT_PATH_TMP = 'lib/GenericStatelessComponent'; | ||
| const GENERIC_COMPONENT_PATH = 'lib/GenericComponent'; | ||
| const GENERIC_COMPONENT_PATH_TMP = 'lib/GenericComponent'; | ||
| const GENERIC_COMPONENT_STYLES_PATH = 'lib/Styles'; | ||
| const GENERIC_STATELESS_COMPONENT_PATH = './lib/genericStateless.js'; | ||
| const GENERIC_STATELESS_COMPONENT_PATH_TMP = './lib/genericStatelessTmp.js'; | ||
| const GENERIC_COMPONENT_PATH = './lib/generic.js'; | ||
| const GENERIC_COMPONENT_PATH_TMP = './lib/genericTmp.js'; | ||
| const GENERIC_COMPONENT_STYLES_PATH = './lib/styles.js'; | ||
@@ -23,5 +23,4 @@ const createComponent = function(name, newPath, stateless) { | ||
| const componentPath = path.join(stateless ? GENERIC_STATELESS_COMPONENT_PATH : GENERIC_COMPONENT_PATH, 'index.js'); | ||
| const componentPathTmp = path.join(stateless ? GENERIC_STATELESS_COMPONENT_PATH_TMP : GENERIC_COMPONENT_PATH_TMP, 'indexTmp.js'); | ||
| const componentStylePath = path.join(GENERIC_COMPONENT_STYLES_PATH, 'styles.js'); | ||
| const componentPath = stateless ? GENERIC_STATELESS_COMPONENT_PATH : GENERIC_COMPONENT_PATH; | ||
| const componentPathTmp = stateless ? GENERIC_STATELESS_COMPONENT_PATH_TMP : GENERIC_COMPONENT_PATH_TMP; | ||
@@ -31,3 +30,3 @@ created = created && copyFile(componentPath, componentPathTmp); | ||
| created = created && copyFile(componentPathTmp, indexNewPath); | ||
| created = created && copyFile(componentStylePath, stylesNewPath); | ||
| created = created && copyFile(GENERIC_COMPONENT_STYLES_PATH, stylesNewPath); | ||
| return created && removeFile(componentPathTmp); | ||
@@ -34,0 +33,0 @@ }; |
+1
-1
| { | ||
| "name": "react-native-component", | ||
| "version": "0.1.6", | ||
| "version": "0.1.7", | ||
| "description": "Generate skeletons for react native components", | ||
@@ -5,0 +5,0 @@ "main": "./lib/fileHandler.js", |
+1
-1
@@ -12,3 +12,3 @@ # react-native-component | ||
| |- ComponentName | ||
| |--- index.js | ||
| |--- generic.js | ||
| |--- styles.js | ||
@@ -15,0 +15,0 @@ ``` |
| import React, { Component } from 'react'; | ||
| import { View, Text } from 'react-native'; | ||
| import styles from '../Styles/styles'; | ||
| class GenericComponent extends Component { | ||
| render() { | ||
| return ( | ||
| <View style={styles.container}> | ||
| <Text>GenericComponent!</Text> | ||
| </View> | ||
| ); | ||
| } | ||
| } | ||
| GenericComponent.propTypes = { | ||
| }; | ||
| export default GenericComponent; |
| import React from 'react'; | ||
| import { View, Text } from 'react-native'; | ||
| import styles from './styles'; | ||
| const GenericComponent = () => ( | ||
| <View style={styles.container}> | ||
| <Text>GenericComponent!</Text> | ||
| </View> | ||
| ); | ||
| GenericComponent.propTypes = { | ||
| }; | ||
| export default GenericComponent; |
| import { StyleSheet } from 'react-native'; | ||
| const styles = StyleSheet.create({ | ||
| container: { flex: 1 } | ||
| }); | ||
| export default styles; |
Debug access
Supply chain riskUses debug, reflection and dynamic code execution features.
Found 1 instance in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
Debug access
Supply chain riskUses debug, reflection and dynamic code execution features.
Found 1 instance in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
6990
-1.87%123
-0.81%