title: Fetch data in React TinyMCE custom dialog
body: <p>Is it possible to create a custom dialog (React TinyMCE) that fetches data from an API and lists items for the user to select one?
  Appearently, TinyMCE only allows me to create a custom dialog with static data.</p>
  <pre><code>const internalLinksDialog = editor =&gt; ({
  title: 'Internal Links',
  body: {
      type: 'panel',
      items: [
          {
              type: 'input',
              name: 'search',
              inputMode: 'text',
              placeholder: 'Search internal links',
          },
          // ...render a list with items
      ],
  },
  initialData: {
      search: '',
      items: [], // ...data fetched from an api
  },
  onSubmit: api =&gt; {
      const data = api.getData();
  
      editor.execCommand('mceInsertContent', false, `&lt;p&gt;${JSON.stringify(data)}&lt;/p&gt;`);
      api.close();
  },
  });
  </code></pre>