Socket
Socket
Sign inDemoInstall

react-native-material-bottom-navigation

Package Overview
Dependencies
Maintainers
1
Versions
24
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-native-material-bottom-navigation - npm Package Compare versions

Comparing version 0.6.0 to 0.6.1

17

lib/BottomNavigation.js

@@ -140,3 +140,3 @@ /**

} else {
this.refs[`tab_${newTabIndex}`].setTabActive()
this.refs[`tab_${newTabIndex}`].setTabActive({ forceAnimation: true })
}

@@ -215,4 +215,7 @@ }

_handleTabChange = ({ tabIndex, barBackgroundColor }) => {
if (this.nextActiveTab === this.activeTab || !this._canChangeTabs()) {
_handleTabChange = (args, opts) => {
const { tabIndex, barBackgroundColor } = args
const { updateActiveTab, forceAnimation = false } = opts
if (!this._canChangeTabs() && !forceAnimation) {
return

@@ -229,3 +232,3 @@ } else {

// (see componentWillReceiveProps)
this.nextActiveTab = tabIndex
if (updateActiveTab) this.nextActiveTab = tabIndex

@@ -235,3 +238,5 @@ // Delegation to next tick will cause smoother animations

// Call onTabChange Event Callback
this.props.onTabChange(tabIndex, this.state.activeTab)
if (updateActiveTab) {
this.props.onTabChange(tabIndex, this.state.activeTab)
}

@@ -271,3 +276,3 @@ // Checks in general if component is still mounted.

// Finally, update tab and set it active
this.setState({ activeTab: tabIndex })
if (updateActiveTab) this.setState({ activeTab: tabIndex })
})

@@ -274,0 +279,0 @@ })

@@ -235,8 +235,9 @@ /**

_handleTabPress = () => {
this.props.onPress
? this.props.onPress(this.props.tabIndex)
: this.setTabActive()
this.props.onPress && this.props.onPress(this.props.tabIndex)
// if onPress is set, only run the (ripple) animation, don't set it active
this.setTabActive({ updateActiveTab: !this.props.onPress })
}
setTabActive = () => {
setTabActive = ({ updateActiveTab = true, forceAnimation = false }) => {
// Setting the tab active is job of the BottomNavigation Component,

@@ -248,3 +249,3 @@ // so call it's function to handle that.

iconRef: this.refs._bnic
})
}, { updateActiveTab, forceAnimation })
}

@@ -251,0 +252,0 @@

{
"name": "react-native-material-bottom-navigation",
"version": "0.6.0",
"version": "0.6.1",
"description": "JS Implementation of the Material Design Guidelines' Bottom Navigation for react-native",

@@ -5,0 +5,0 @@ "main": "index.js",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc