title: Widget iOS 14 create the ui with react native using swift ui
body: <p>Widget example in iOS:</p>
  <p><a href="https://i.stack.imgur.com/qorO4.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/qorO4.png" alt="enter image description here" /></a></p>
  <p>Example of the react-native(js) code written below:</p>
  <p><a href="https://i.stack.imgur.com/cq4cb.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/cq4cb.png" alt="enter image description here" /></a></p>
  <pre><code>import React from 'react';
  import { Text, View, NativeModules } from 'react-native';
  var Widget = NativeModules.Widget;
  
  const App = () =&gt; {
    return (
      &lt;Widget&gt;
        &lt;View
          style={{
            justifyContent: 'center',
            alignItems: 'center',
            backgroundColor: '#dee1e3',
            borderRadius: 4,
          }}&gt;
          &lt;Text&gt;San Francisco&lt;/Text&gt;
          &lt;Text style={{ fontSize: 30 }}&gt;62°F&lt;/Text&gt;
        &lt;/View&gt;
      &lt;/Widget&gt;
    );
  };
  
  export default App;
  </code></pre>
  <p>There is still not much documentation on creating widgets with <code>Swift ui</code> for <code>iOS 14</code>.</p>
  <p>It wouldn't seem that difficult to create a widget using <code>Swift ui</code>, but there isn't much information.</p>
  <p>So I thought it would be interesting to develop the ui using <code>react-native</code> and use <code>swift ui</code> just to create the widget for <code>iOS</code>.</p>
  <p>Idea is this, everything inside the tag (let's call it that) <code>&lt;Widget&gt;</code> (hence its child) should be the content of the <code>Widget</code>.</p>
  <p>I did not find anything in the documentation, I was wondering exists in <code>Swift ui</code> or something for <code>iOS</code>, to use child content as <code>UI</code> for app.</p>
  <p>Surely such a thing will be impossible, but dreaming costs nothing.</p>