Move height to layout effect
nandorojo opened this issue · 5 comments
nandorojo commented
react-native-live-markdown/src/MarkdownTextInput.web.tsx
Lines 467 to 474 in 348fcd2
Hey! Reviewing the web code, and I'm wondering if this should get moved to a layout effect since it's adjusting the height and you'd want to do this before painting. I'm happy to PR it if so!
nandorojo commented
The same would go for this effect:
react-native-live-markdown/src/MarkdownTextInput.web.tsx
Lines 452 to 465 in 348fcd2
I can test them out a bit to be certain
tomekzaw commented
@nandorojo Thanks for reviewing the code and suggesting the improvements, feel free to submit PRs!
cc @Skalakid, the author of web implementation
nandorojo commented
Cool.
Making a small note for SSR support:
const useClientEffect = typeof window === 'undefined' ? useEffect : useLayoutEffect