New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

react-native-component

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-native-component - npm Package Compare versions

Comparing version
0.1.6
to
0.1.7
+20
lib/generic.js
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;
+8
-9
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 @@ };

{
"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",

@@ -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;