1

I recently saw this npm package that I am fairly assuming is a part of the whole ant design pro library which gives us the pro table. I really liked the feature of showing/hiding columns on the go for pro table, but for my project I already have ant design 5 installed and hence cannot install another whole library. After correctly installing the package on my project and giving it the proper(i hope) parameters, I see the table is rendering fine, albeit no data is loaded unless I press the sort button, but the options are given in chinese/mandarin I am not sure. enter image description here

Googling found me some very similar problems but their solutions proposed using a function called IntlProvider, which they seem to import from ant design pro table itsel. But when i use the exact same command, i get an error :

enter image description here

I am really not sure how to go about debugging this. I have seen multiple examples of people using similar functions and having their ant design components changing language easily. The npm package is being very actively updated every day as well. I have scoured many answers on stack overflow regarding this error, but nobody seems to have the same error as me. Is it becaues the pro table library I am using is missing some features that facilitate language conversion? Am i supposed to use an updated function for language conversion? Because I can see the library came prepared with many languages support: enter image description here

This is how I have used the Protable in my project:

<ConfigProvider locale={enUSIntl}>
            <ProTable
                columns={columns} request={async (
                params: {
                    pageSize: 10;
                    current: currentPage;
                },
            ) => {
                return {
                    data: filteredData,
                    success: true,
                    total: 100,
                };
            }}/></ConfigProvider>


...


export default <IntlProvider value={enUSIntl}>connect(mapStateToProps)(ProductEmployeeScreen)</IntlProvider>;
Rohit Kumar
  • 684
  • 2
  • 17
  • 39

1 Answers1

0

set baseNavigator to false in file config/config.ts

locale: {
    default en-US,
    antd: true,
    // default true, when it is true, will use `navigator.language` overwrite default
    baseNavigator: false,
  },
duongmt
  • 1
  • 2