Controller.propTypes = { count: PropTypes.number.isRequired, // count가 숫자형으로 필수 buttonClick: PropTypes.func.isRequired, // buttonClick이 함수형으로 필수 }; 전 위와같은 코드를 작성하지 않으면 props가 missing이라는 오류가 뜹니다. 혹시 이유를 알 수 있을까요?
강의 6.3) 기능구현하기 카운트 컴포넌트를 state로 만들어야 한다고 하셨는데 state대신 ref를 사용하면 어떻게 되나요? ref는 리렌더링을 유발하지는 않지만 dom에 접근이 가능한 걸로 알고 있습니다. 그렇다면 ref를 사용해도 무방하지 않냐는 것이 저의 생각입니다. ref를 사용한다면 ui변경이 가능하지만 리액트가 그 수정을 감지 못하는 문제가 생겨서 state를 사용하는 것인가요?
안녕하세요, React Navigation 강의를 수강하다가 오류가 해결되지 않아서 질문드립니다. expo를 통해 다음과 같이 index.js에 React Navigation을 적용했습니다. import { store } from "@/redux/store"; import MainScreen from "./screens/MainScreen"; import { Provider } from "react-redux"; import { NavigationContainer } from "@react-navigation/native"; import { createNativeStackNavigator } from "@react-navigation/native-stack"; import LoginScreen from "./screens/LoginScreen"; export default function HomeScreen() { const Stack = createNativeStackNavigator(); return ( <Provider store={store}> <NavigationContainer> <Stack.Navigator> <Stack.Screen name="Main" component={MainScreen} /> <Stack.Screen name="Login" component={LoginScreen} />{" "} </Stack.Navigator> </NavigationContainer> </Provider> ); } 그러나 다음과 같은 오류가 뜨며 빈화면만 보이더라구요ㅠ Error: Looks like you have nested a 'NavigationContainer' inside another. Normally you need only one container at the root of the app, so this was probably an error. If this was intentional, pass 'independent={true}' explicitly. Note that this will make the child navigators disconnected from the parent and you won't be able to navigate between them. 찾아보니 NavigationContainer가 중첩되었다는 것 같은데, 저는 계속해서 그대로 강의를 따라가고 있었고, 따로 NavigationContainer를 적용한 파일이 존재하지 않습니다 ㅠ 다음 속성을 추가해도 오류가 해결되지 않습니다 ㅠ 아마 어디선가 부모에서 NavigationContainer가 적용된 것 같은데 찾을 수가 없네요 ㅠㅠ independent={true} 조금 더 찾아보니 expo-router랑 충돌이 난 거일 수도 있다는데 정확하게 모르겠네요 ㅠㅠ
섹션04 이후 진행되는 app 라우터 강의에 rc버전을 설치 section04 이후 강의 중 next 14버전(latest)에서 사용하지 못하는 부분이 있을까요??? 그렇다면 어떤 것들이 있을까요? 강의를 바탕으로 개인 블로그를 만들어 배포해 볼 생각인데 rc버전을 활용하는 것에 문제는 없을까요?? next 강의를 들으며 느낀것이 최대한 dynamic한 사이트(페이지)들을 최대한 static하게 만들면서도 dynamic하게 만드는 것. <<< 이것이 next의 핵심 이라고 느껴지는데 제가 이해한 부분이 맞을까요??
위와 같이 되어있는 구조에서 FABRIC에 대한 CSS 주소가 없어서 XPATH 주소로 아래와 같이 크롤링 코드를 작성하였습니다. fabric = driver.find_element(By.XPATH, '//*[@id="prod_goods_form"]/div[1]/div/p[3]').text.strip() 그런데 계속해서 오류가 납니다. 왜그런걸까요? 안에 내용이 text인데 뒤에 또 text를 붙여서 그런건가요? 에러는 아래와 같이 나옵니다. return self.execute(Command.FIND_ELEMENT, {"using": by, "value": value})["value"] Session info: chrome=128.0.6613.138); For documentation on this error, please visit: https://www.selenium.dev/documentation/webdriver/troubleshooting/errors#invalid-selector-exception Stacktrace:
count ++의 의미를 제대로 모르겠네요, count를 썼을 때는 앞의 조건들이 일치하는 값의 갯수를 적어주는 거 같은데, ++면 1씩 더해줘라 이런뜻이니ㅠ 최종 카운트갯수에 1을 더해서 최종 답을 적으란 말도 아니고, count + = i ; 이런 것도 있네요ㅠ 설명 부탁드립니다.