problem description
I"m developing a single-page application using the dva,antdesign and react-intl frameworks, and internationalizing using react-intl. I wrap all the components in the outermost index.js with < IntlProvider > so that all subcomponents can access the intl object.
the environmental background of the problems and what methods you have tried
most of the pages and components are working properly, but the Modal of antdesign reports an error with < FormattedMessage id= "message.id" / > of react-intl. The error message is: [React Intl] Could not find required intl
object.. < IntlProvider > needs to exist in the component ancestry.
I looked at the structure of the component through Chrome"s React plug-in, and the reason for this problem is that the Model component is written on the outermost (and App level) so it is not a subcomponent of < IntlProvider >.
I don"t want to write < IntlProvider > again in every component or page that uses Modal. Is there any good solution?