관리 메뉴
둘에서 하나로....
react native useEffect 의 변수할당이 안될경우 해결방법
function test(){ const [page, setPage] = useState(0); const [refreshing, setRefresh] = useState(false); const onRefresh = () => { setPage(10); // 이 부분이 적용 안됨. setRefresh(true); // 이 부분이 적용 안됨 } } 위와 같이 했는데... onRefresh가 호출은 되지만 변수가 변경이 되지 않는 문제가 있다. 이럴때는 아래와 같이 변경하므로써 해결 가능하다. const onRefresh = useCallback(async () => { setPage(0); setRefresh(false); }, [refreshing]); 참고용 메모..
프로그래밍
2020. 12. 18. 14:00
[php] utf-8에서 한글+영문 혼합문자 자르기
function hangul_pad($str, $len){ $a = strlen($str); if($a>$len){ return mb_strimwidth($str,0,$len); } $a = mb_strwidth($str); $b = $len-$a; for($i=0; $i
프로그래밍
2020. 11. 16. 12:43
[php] 다중 셀렉트(시도, 구군, 동을 선택하는 프로그램)
php와 jquery로 작성된 다중 셀렉트 예문입니다.
프로그래밍
2020. 10. 31. 21:50