Function FetchView

FetchView is a React component that provides a convenient way to handle asynchronous data fetching and rendering.

  • Type Parameters

    • P extends unknown = object

      The type of the payload for the data fetching.

    • A = any

      The type of the first element in the array of data returned by the state function.

    • B = any

      The type of the second element in the array of data returned by the state function.

    • C = any

      The type of the third element in the array of data returned by the state function.

    • D = any

      The type of the fourth element in the array of data returned by the state function.

    • E = any

      The type of the fifth element in the array of data returned by the state function.

    • F = any

      The type of the sixth element in the array of data returned by the state function.

    • G = any

      The type of the seventh element in the array of data returned by the state function.

    • H = any

      The type of the eighth element in the array of data returned by the state function.

    • I = any

      The type of the ninth element in the array of data returned by the state function.

    • J = any

      The type of the tenth element in the array of data returned by the state function.

    Parameters

    • props: IFetchViewProps<P, A, B, C, D, E, F, G, H, I, J>

      The props object containing the following properties:

      • animation: The animation type for the component.
      • className: The CSS class name(s) for the component.
      • style: The inline style object for the component.
      • Loader: The component to render while data is being fetched.
      • Error: The component to render if an error occurs during data fetching.
      • onLoadEnd: A callback function to be called when data loading ends.
      • onLoadStart: A callback function to be called when data loading starts.
      • children: A function that receives the fetched data as arguments and returns the JSX to be rendered.
      • state: The function to transform the payload into an array of data.
      • payload: The payload for the data fetching.
      • otherProps: Any additional props to be passed to the underlying components.

    Returns Element

    • The rendered JSX for the FetchView component.