Move height to layout effect
nandorojo opened this issue · comments
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!
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
@nandorojo Thanks for reviewing the code and suggesting the improvements, feel free to submit PRs!
cc @Skalakid, the author of web implementation
Cool.
Making a small note for SSR support:
const useClientEffect = typeof window === 'undefined' ? useEffect : useLayoutEffect
FYI There's a PR that eliminates .web.tsx
file extension in favor of .native.tsx
(#168). Let's get it merged first so we can avoid conflicts.
Sounds good.
Also, PR opened #169