Closed Frexuz closed 5 years ago
I'd appreciate any insights.. We're actually closing in our product launch :) This is one of our outstanding "bugs".
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Did not find the 'normal' solution, but needed to resolve it. To make it work, it is needed to re-render/init chat. I did it the next way:
import 'dayjs/locale/es'
const { locale } = useSelector(state => state. ...)
const [ isChatInitialized, setIsChatInitialized ] = useState(true)
useEffect(() => {
if (locale) {
setIsChatInitialized(false)
setTimeout(() => setIsChatInitialized(true), 250)
}
}, [locale])
<View>
{isChatInitialized &&
<GiftedChat
locale={locale}
...
/>
}
</View>
Issue Description
GiftedChat does not re-render when
locale
is a prop (from Redux in my case)Steps to Reproduce / Code Snippets
zh-cn
en-gb
zh-cn
en-gb
)Simplified example
Expected Results
GiftedChat should re-render
Additional Information