Closed TPXP closed 3 months ago
Why do you think this should be done in the core library instead of in a wrapper in your project?
Hmm, are you suggesting something like this instead?
import React, { useRef } from 'react';
import Popover from 'react-native-popover-view';
function App() {
const popoverRef = useRef();
return (
<Popover
ref={popoverRef}
from={(
<TouchableOpacity>
<Text>Press here to open popover!</Text>
</TouchableOpacity>
)}>
<TouchableOpacity onPress={() => popoverRef.current.setState({isVisible: false})}>
<Text>Tap to close me</Text>
</TouchableOpacity>
</Popover>
);
}
This would make my code less reliable because it would break if the name of the state property changes, also calling setState
directly on a component feels wrong.
I could re-implement the isVisible
and from
logic in my wrapper but since this is already implemented in the module (I know it's here), I'd rather leave it to you 😄.
@SteffeyDev Hello there, just wanted to give a quick heads up for this. Is there anything I can do push this forward?
@TPXP Due to how long it's been since I've worked on this, I can't even spin up my expo test project anymore, which I would need to run regression tests. I'd be fine merging this in, but I'm not sure when I will have time to get everything up to date and tested so that I can deploy a new version on NPM.
Thanks for merging! 🙌 No worries, I can apply the patch on my side in the meantime. 👍
The main motivation here is shorter code and the possibility to wrap this component in a component that passes its own
from
value