Closed mlecoq closed 3 years ago
@mlecoq 👋 I think it's doable, but could you provide a simple snippet of your current approach? :)
@mobily, Sure !
Here it is
<RemarkItemContainer first={first} ref={containerRef}>
<Box padding={[10, 15]}>
....
</Box>
</RemarkItemContainer>
RemarkItemContainer is created with styles-components
const RemarkItemContainer = styled.View...
My goal is to be able to have
const RemarkItemContainer = styled(Box)...
<RemarkItemContainer first={first} ref={containerRef} padding={[10, 15]}>
....
</RemarkItemContainer>
And elsewhere
containerRef.current.measure....
@mlecoq 👋 sorry it took so loooong! I finally found spare time, the viewRef
prop has been added to all components in v1.3.0
. You can see the example here: https://github.com/mobily/stacks/blob/9a5deb65fbe73391988d7a4470bdae7ed26bafa8/example/src/typescript/screens/Playground/index.tsx#L23
Hi,
I'm using more and more your lib (and delete tons of styles), and I am often annoyed when I want to use a ref on a
Box
I would like to measure it using https://reactnative.dev/docs/direct-manipulation#measurecallback
For the moment I wrap my
Box
with a view but I would like to measure the Box directlyWhat do you think ? Could we have a forward ref on Box ?