Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Slider<SS>

prop

watchProp - The property to watch if on which sliding will occur. This must be a literal value.

prop

childProps - The properties of child element.

prop

direction - The direction in which this change's sliding effect should go.

prop

children - This child JSX element wrapped in Slider component on which sliding effect will happen.

prop

childStyles - Some styles of children, which includes width, height and transition timing related styles.

prop

slideOnAppear - If we want the sliding effect when we first see the screen. Optional Prop.

prop

fadeOnSlide - Should the slide fade on entering or exiting. Optional Prop.

prop

sizePercentageDuringSlide - % of size which should be on screen. Useful only with fadeOnSlide prop. Optional.

prop

transitionDone - Transition done callback. Optional.

Type parameters

  • SS

Hierarchy

Index

Constructors

constructor

Properties

context

context: any

Private curWatchCount

curWatchCount: number = 0

Private firstRender

firstRender: boolean = true

Private prevWatchCount

prevWatchCount: number = 0

props

props: Readonly<object> & Readonly<ISliderProps>

refs

refs: object

Type declaration

  • [key: string]: ReactInstance

Private selfRef

selfRef: HTMLDivElement | null = null

state

state: Readonly<ISliderState>

transitionCycle

transitionCycle: SliderCycleState = SliderCycleState.Full

Methods

Private beforeUpdationProcess

  • beforeUpdationProcess(): void

Private enterTransitionDone

  • enterTransitionDone(): void

forceUpdate

  • forceUpdate(callBack?: undefined | function): void
  • Parameters

    • Optional callBack: undefined | function

    Returns void

Private getCLonedElems

  • getCLonedElems(): Element[]
  • This method makes two clones of child. One with current properties which will enter and another with previous properties which will exit.

    Returns Element[]

render

  • render(): Element

setState

  • setState<K>(state: function | null | S | object, callback?: undefined | function): void
  • Type parameters

    • K: keyof ISliderState

    Parameters

    • state: function | null | S | object
    • Optional callback: undefined | function

    Returns void

shouldComponentUpdate

Static Optional UNSAFE_componentWillMount

  • UNSAFE_componentWillMount(): void

Static Optional UNSAFE_componentWillReceiveProps

  • UNSAFE_componentWillReceiveProps(nextProps: Readonly<ISliderProps>, nextContext: any): void

Static Optional UNSAFE_componentWillUpdate

  • UNSAFE_componentWillUpdate(nextProps: Readonly<ISliderProps>, nextState: Readonly<ISliderState>, nextContext: any): void

Static Optional componentDidCatch

  • componentDidCatch(error: Error, errorInfo: ErrorInfo): void
  • Catches exceptions generated in descendant components. Unhandled exceptions will cause the entire component tree to unmount.

    Parameters

    • error: Error
    • errorInfo: ErrorInfo

    Returns void

Static Optional componentDidMount

  • componentDidMount(): void
  • Called immediately after a component is mounted. Setting state here will trigger re-rendering.

    Returns void

Static Optional componentDidUpdate

  • Called immediately after updating occurs. Not called for the initial render.

    The snapshot is only present if getSnapshotBeforeUpdate is present and returns non-null.

    Parameters

    Returns void

Static Optional componentWillMount

  • componentWillMount(): void

Static Optional componentWillReceiveProps

  • componentWillReceiveProps(nextProps: Readonly<ISliderProps>, nextContext: any): void

Static Optional componentWillUnmount

  • componentWillUnmount(): void
  • Called immediately before a component is destroyed. Perform any necessary cleanup in this method, such as cancelled network requests, or cleaning up any DOM elements created in componentDidMount.

    Returns void

Static Optional componentWillUpdate

Static getDerivedStateFromProps

Static Optional getSnapshotBeforeUpdate

  • Runs before React applies the result of render to the document, and returns an object to be given to componentDidUpdate. Useful for saving things such as scroll position before render causes changes to it.

    Note: the presence of getSnapshotBeforeUpdate prevents any of the deprecated lifecycle events from running.

    Parameters

    Returns SS | null

Static Optional shouldComponentUpdate

  • shouldComponentUpdate(nextProps: Readonly<ISliderProps>, nextState: Readonly<ISliderState>, nextContext: any): boolean
  • Called to determine whether the change in props and state should trigger a re-render.

    Component always returns true. PureComponent implements a shallow comparison on props and state and returns true if any props or states have changed.

    If false is returned, Component#render, componentWillUpdate and componentDidUpdate will not be called.

    Parameters

    Returns boolean

Generated using TypeDoc