
DefaultStackNavigator.js
<Stack.Screen name={'BoxOffice'} component={BoxOffice} options={{headerShown: false}} //๊ธฐ๋ณธ๊ฐ: true />
๊ฐ ํ์ด์ง SCREEN ํ์ผ์์
setOptions๋ฅผ ํตํด ์ง์ MovieDetails.js
useEffect( //๊ฐ title์ด ๋ฐ๋ ๋๋ง๋ค ๋ ๋๋ง๋์ด์ผ ํ๋ฏ๋ก,,, ((effect = () => { if (data) { //data๊ฐ ์์ผ๋ฉด navigation.setOptions({ title: detail.movieNm, }); } }), (deps = [data])), );
screenOptionsํ์ฉDefaultStackNavigator.js
<Stack.Navigator screenOptions={{headerShown: false}}> <Stack.Screen name={'BoxOffice'} component={BoxOffice} options={{headerShown: false}} /> <Stack.Screen name={'MovieDetail'} component={MovieDetail} /> <Stack.Screen name={'SearchResult'} component={SearchResult} /> </Stack.Navigator>