CubaAppProvider

CubaAppProvider initializes main CUBA React Core components and provides them to the client application. It receives an instance of REST API service and an optional config object which has the following interface:

import {PropertyType} from "@cuba-platform/rest";

export interface CubaAppConfig {
  dataTransferFormats?: Partial<Record<PropertyType, string>>;
  displayFormats?: Partial<Record<PropertyType, string>>;
}
  • dataTransferFormats can be used to override the default formats used to (de)serialize the data transferred by REST API.

  • displayFormats can be used to override the formats used for data presentation.

See PropertyType in CUBA REST JS API docs for the list of available property types.

Only formats for temporal types can currently be overridden this way.
<CubaAppProvider cubaREST={cubaREST}
                 config={{
                   dataTransferFormats: {
                     localDateTime: 'DD/MM/YYYY HH:mm:ss'
                   }
                 }}
>
   // App component tree
</CubaAppProvider>