-1

Is there any kind of components in react native with two buttons in right and left like SwipeRow, with a little different?, I am looking for a component that shows buttons in right and left without need the user swipe items to left or right

roz333
  • 695
  • 2
  • 18
  • 30
  • Can you be a bit more explicit in what your expectation is? A design spec, an image? What have you attempted? Please update question with more details. – Drew Reese Mar 14 '20 at 23:15
  • So you want a row with two buttons on each side that are always visible instead of a person swiping to make them visible? so [button][row-content][button]? – HBSKan Mar 14 '20 at 23:39
  • @HBSKan The problem is that i need two buttons that have functions that do something over```row-content``` for example after pressing one button ```row-content``` and another button be disappeared – roz333 Mar 15 '20 at 00:06
  • This doesn't sound like a general purpose container (i.e. sounds really specific your use-case), so I doubt one exists. – Drew Reese Mar 15 '20 at 00:17

2 Answers2

0

I think that there is not a native component with this design but you can do this easily creating a View with flexDirection:'row' and inside <Button><ComponentToBeUsed><Button>.

  • The problem is that i need two buttons that have functions that do something over``ComponentToBeUsed ```for example after pressing one button ```ComponentToBeUsed``` and another button be disappeared – roz333 Mar 14 '20 at 23:58
  • so add a hoc/hook with a boolean prop which changes when press one of the buttons and add conditional rendering of the other button. – Marco Fiorito Mar 15 '20 at 00:01
  • This makes components so complicated and need to write a lot of code, This is why i am asking for a particular component – roz333 Mar 15 '20 at 00:03
0

Maybe You can use flexDirection: 'row'. Like this

 <View style={{
          flex: 1,
          flexDirection: 'row'
        }}>
   <View style={{width: 60, height: 50}}>
     <Button title='Left'/>
   </View>
   <View style={{position: 'absolute', right: 0, width: 60, height: 50}}>
     <Button title='Right'/>
   </View>
 </View>