diff --git a/index.js b/index.js
index 4d80ad7..9eb66be 100644
--- a/index.js
+++ b/index.js
@@ -3,26 +3,23 @@ import PropTypes from 'prop-types';
import { Image } from 'react-native';
import * as flags from './src';
-const Flag = props => {
- const flag = flags[props.type][`icons${props.size}`][props.code];
- const unknownFlag = flags[props.type][`icons${props.size}`]['unknown'];
+const Flag = ({ size = 64, type = "shiny", code, style }) => {
+ const flag = flags[type][`icons${size}`][code];
+ const unknownFlag = flags[type][`icons${size}`]['unknown'];
return (
-
+
);
};
Flag.propTypes = {
size: PropTypes.number,
type: PropTypes.string,
-};
-
-Flag.defaultProps = {
- size: 64,
- type: "shiny",
+ code: PropTypes.string.isRequired,
+ style: PropTypes.object,
};
export default Flag;