일일회고 start!!
<Suspense fallback={<Loading/>}>
<Component />
<Suspense>
react-i18next
를 사용할 경우 default로 Suspense를 사용하고 있다. 사용하지 않으려면 i18n config에서 react: useSuspense
flag를 false로 설정해주면 된다고 한다.//Example config
i18n
.use(Backend)
.use(LanguageDetector)
.use(initReactI18next)
.init({
fallbackLng: "en",
debug: true,
resources: {
},
interpolation: {
escapeValue: false,
},
react: {
wait: true,
useSuspense: false, // 이런식으로!
},
})
let this_is_null = null;
let answer = this_is_null ?? "yes"; // yes
||
를 사용할 때와 다른점||
는 왼쪽의 값을 자동으로 f/t로 형변환을 하는 반면, ??
는 왼쪽 값이 확실하게 null, undefined 일 때만 처리한다.let myText = ''; // An empty string (which is also a falsy value)
let notFalsyText = myText || 'Hello world'; // 답 : Hello world
let preservingFalsy = myText ?? 'Hi neighborhood'; // 답 : ''