Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 12 additions & 2 deletions babel.config.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
module.exports = {
presets: ['module:react-native-builder-bob/babel-preset'],
module.exports = function (api) {
const isTest = api.env('test');
api.cache(true);

return {
presets: isTest
? [['@react-native/babel-preset', { disableImportExportTransform: true }]]
: [
['@babel/preset-flow', { all: true }],
'module:react-native-builder-bob/babel-preset',
],
};
};
38 changes: 33 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -64,24 +64,29 @@
"registry": "https://registry.npmjs.org/"
},
"devDependencies": {
"@babel/core": "^7.28.5",
"@babel/preset-flow": "^7.27.1",
"@commitlint/config-conventional": "^20.2.0",
"@evilmartians/lefthook": "^2.0.11",
"@react-native/babel-preset": "^0.81.5",
"@react-native/eslint-config": "^0.81.5",
"@release-it/conventional-changelog": "^10.0.3",
"@types/jest": "^30.0.0",
"@types/react": "^19.1.0",
"commitlint": "^20.2.0",
"del-cli": "^7.0.0",
"eslint": "^9.39.2",
"eslint-config-prettier": "^10.1.8",
"eslint-plugin-prettier": "^5.5.4",
"eslint": "^8.57.1",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-ft-flow": "^3.0.11",
"eslint-plugin-prettier": "^5.2.1",
"hermes-eslint": "^0.33.0",
"jest": "^30.2.0",
"prettier": "^3.7.4",
"react": "19.1.0",
"react-native": "0.81.5",
"react-native-builder-bob": "^0.39.1",
"release-it": "^19.1.0",
"typescript": "^5.9.3"
"typescript": "^5.5.4"
},
"resolutions": {
"@types/react": "^19.1.0"
Expand All @@ -95,10 +100,30 @@
],
"packageManager": "yarn@3.6.1",
"jest": {
"preset": "react-native",
"testEnvironment": "node",
"modulePathIgnorePatterns": [
"<rootDir>/example/node_modules",
"<rootDir>/lib/"
],
"transformIgnorePatterns": [
"node_modules/(?!(@?react-native|@react-native-community|@react-native/|react-native-svg)/)"
],
"transform": {
"^.+\\.(js|jsx|ts|tsx)$": [
"babel-jest",
{
"configFile": "./babel.config.js"
}
]
},
"setupFiles": [],
"moduleFileExtensions": [
"ts",
"tsx",
"js",
"jsx",
"json",
"node"
]
},
"commitlint": {
Expand Down Expand Up @@ -129,6 +154,9 @@
"@react-native",
"prettier"
],
"plugins": [
"prettier"
],
"rules": {
"react/react-in-jsx-scope": "off",
"prettier/prettier": [
Expand Down
10 changes: 6 additions & 4 deletions src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@ import { useEffect, useState } from 'react';
import Svg from 'react-native-svg';
import CountryPath from './components/CountryPath';

const svgContainerStyle = {
justifyContent: 'center',
alignItems: 'center',
} as const;

type WorldMapProps = {
color?: string;
isSelectable?: boolean;
Expand Down Expand Up @@ -233,10 +238,7 @@ export function WorldMap({
height={'100%'}
viewBox="0 0 1000 500"
fill={'none'}
style={{
justifyContent: 'center',
alignItems: 'center',
}}
style={svgContainerStyle}
stroke={'#fff'}
strokeWidth={1}
{...props}
Expand Down
Loading
Loading