title: Using Antd's message with typescript
body: <p>I am using</p>
  <p>&quot;antd&quot;: &quot;^4.21.3&quot;, &quot;typescript&quot;: &quot;^4.7.4&quot; with react 18, and I am facing the problem of error config type! The error message is below..</p>
  <pre><code>// current code
  import { message } from 'antd'
  
  function AlertModal({ type = 'success', duration = 3, ...props }) {
  const config = {
      duration: duration,
      ...props,
  }
  return message[type as keyof typeof message](config)
  }
  export default AlertModal
  </code></pre>
  <p><a href="https://i.stack.imgur.com/CTZOS.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/CTZOS.png" alt="enter image description here" /></a></p>
  <p>Does anyone have any idea how can I solve this annoying problem??</p>