2

I have this view that map a list of buttons and display them to the user, then the user can select which view to see.

it use a list because this component is used in multiple views and the buttons are different.

I wanted to create a sliding effect when the user toggle between these buttons without success. I used "react-native-reanimated" but I couldn't make it work

Any idea or suggestion how to make this sliding effect?

Thanks

    updateView(value) {
        this.props.changeView(value);
        this.setState({ selected: value });
    }
    render() {

        let {buttonsList} = this.props
        let {selected } = this.state
        

        return (
                    <View style={routinesStyles.ButtonsContainer}>
                        {buttonsList.map((item) => (
                            <TouchableHighlight
                                onPress={() => this.updateView(item.value)}
                                style={ selected === item.value ? routinesStyles.selected : routinesStyles.notSelected }>
                            >
                                <Text>{item.label}</Text>
                            </TouchableHighlight>
                        ))}
                    </View>
        );
    }
}

something similar to this https://youtu.be/i20R4lwkJzw

GHOST
  • 203
  • 4
  • 14

0 Answers0