2025. 5. 24. 19:58

2025. 5. 18. 17:23

1. react-navigation 태그에 options로 추가

 

const options = { headerShown: false };

 

<Stack.Screen name="Splash" component={SplashScreen} options={options}/>

 

2. 자체 스크린에서 옵션으로 추가

 

const SplashScreen = ({navigation}) => {

useLayoutEffect(() => { navigation.setOptions({ headerShown: false })});

2025. 5. 18. 16:59

0. /assets/fonts 에 .ttf 파일 복사

 

1. npx react-native-assets

 

2. react-native.config.js 파일 생성 후 다음 작성

module.exports = {

project: {

ios: {},

android: {}

},

assets: ['./assets/fonts/']

}

 

3. jsconfig.json 에 다음 작성

{

"compilerOptions": {

"baseUrl": ".",

"paths": {

"@/*":["*"]

    }

  }

}

2025. 5. 18. 15:31

매번 중요해서 두 번 적는다

 

 

 

2025. 4. 27. 18:23

처음 react native를 설치했을 때 실패하면 

 

sudo gem install cocoapods

 

cd ios
pod install

 

cocoapods 을 설치하고 다시 실행하면 된다

 

2025. 3. 4. 21:55

npx react-native run-ios --simulator="iPhone 15 Pro"

2024. 9. 18. 16:33

import { useWindowDimensions } from 'react-native';

 

const width = useWindwoDemensions().width;

const height = useWindowDimensions().height;

 

const { width, height } = useWindowDimensions();

2024. 9. 4. 20:17

1. babel-plugin-module-resolver 설치

 

npm i babel-plugin-module-resolver

 

2. babel.config.js에서 plugins 수정

 

 

3. tsconfig.json 에 compilerOptions 수정

 

 

tsconfig.json이 없으면 jsconfig.json 파일 만들어서
다음과 같이 작성

{
"compilerOptions": {
"baseUrl": ".",
"paths": {
"@/*":["*"]
}
}
}
2024. 8. 11. 15:32

barbel.config.js

 

moduel.exports = {

  presets: ['module:metro-react-native-babel-preset'],

  plugins: ['react-native-reanimated/plugin']

}

 

npx react-native start --reset-cache