Why Gemfury? Push, build, and install  RubyGems npm packages Python packages Maven artifacts PHP packages Go Modules Debian packages RPM packages NuGet packages

Repository URL to install this package:

Details    
@skava/ui / src / components / organisms / Sidebar / SidebarItem / SidebarItem.tsx
Size: Mime:
import React from 'react'
import { observer } from 'xmobx/mobx-react'
import { SidebarItemState } from './SidebarItemState'
import { SidebarItemProps } from './typings'
import { StylehSidebarItem } from './styled'

export function renderSidebar(props) {
  return <StylehSidebarItem {...props} />
}

@observer
class SidebarItem extends React.Component<SidebarItemProps, SidebarItemState> {
  static defaultProps = {
    get state() {
      // only instantiate if needed
      return new SidebarItemState()
    },
  }

  render() {
    console.debug('[Sidebar] SidebarItem props: ')
    console.dir(this.props)

    const { children } = this.props

    return this.props.state.render(this.props)
  }
}

export { SidebarItem }
export default SidebarItem