<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Numan</title>
    <description>The latest articles on DEV Community by Numan (@numandev1).</description>
    <link>https://dev.to/numandev1</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F402399%2F8b81174f-6ad5-4587-b987-2028a8842e2e.jpeg</url>
      <title>DEV Community: Numan</title>
      <link>https://dev.to/numandev1</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/numandev1"/>
    <language>en</language>
    <item>
      <title>Create a React Native sub-component from Component.</title>
      <dc:creator>Numan</dc:creator>
      <pubDate>Mon, 13 Sep 2021 21:03:05 +0000</pubDate>
      <link>https://dev.to/numandev1/create-a-react-native-sub-component-from-component-4ogf</link>
      <guid>https://dev.to/numandev1/create-a-react-native-sub-component-from-component-4ogf</guid>
      <description>&lt;p&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--zFoysBpw--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://raw.githubusercontent.com/nomi9995/react-native-component-splitter/master/src/assets/icon.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--zFoysBpw--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://raw.githubusercontent.com/nomi9995/react-native-component-splitter/master/src/assets/icon.png" alt="alt text" width="238" height="212"&gt;&lt;/a&gt;
&lt;/p&gt;

&lt;p&gt;
  &lt;b&gt;Create a React Native sub-component from Component.&lt;/b&gt;
  &lt;br&gt;
&lt;/p&gt;

&lt;p&gt;
  &lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--o_mxDqgZ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://raw.githubusercontent.com/nomi9995/react-native-component-splitter/master/src/assets/example.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--o_mxDqgZ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://raw.githubusercontent.com/nomi9995/react-native-component-splitter/master/src/assets/example.gif" width="880" height="518"&gt;&lt;/a&gt;
&lt;/p&gt;

&lt;h1&gt;
  
  
  React Native Component Splitter
&lt;/h1&gt;

&lt;p&gt;it is a &lt;strong&gt;VS CODE&lt;/strong&gt; extension which allows us to split React components into sub-components&lt;/p&gt;

&lt;h1&gt;
  
  
  Usage
&lt;/h1&gt;

&lt;p&gt;&lt;strong&gt;1&lt;/strong&gt;. Select the code you want to split to a new sub-component.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2&lt;/strong&gt;. Choose &lt;code&gt;Split Component&lt;/code&gt; from the Right-Click Menu / Command Palette.&lt;br&gt;
or press &lt;code&gt;alt+option+cmd+k&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3&lt;/strong&gt;. Enter a name for the new sub-component.&lt;/p&gt;

&lt;h1&gt;
  
  
  Shortcut keys
&lt;/h1&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Plateform&lt;/th&gt;
&lt;th&gt;Key&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;MAC&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;alt+option+cmd+k&lt;/strong&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;MAC&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;ctrl+shift+k&lt;/strong&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h2&gt;
  
  
  Installation
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://marketplace.visualstudio.com/items?itemName=nomi9995.react-native-component-splitter"&gt;https://marketplace.visualstudio.com/items?itemName=nomi9995.react-native-component-splitter&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Contributors ✨
&lt;/h2&gt;

&lt;p&gt;Thanks goes to these wonderful people (&lt;a href="https://allcontributors.org/docs/en/emoji-key"&gt;emoji key&lt;/a&gt;):&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
  &lt;tr&gt;
    &lt;td&gt;
&lt;a href="https://github.com/nomi9995"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--134zNOM5--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://avatars3.githubusercontent.com/u/36044436%3Fs%3D460%26u%3Dc7471cd9ccec793c7a0fccc7db475a577ff7969d%26v%3D4" alt="Numan" width="460" height="460"&gt;&lt;br&gt;&lt;b&gt;Numan&lt;/b&gt;&lt;/a&gt;&lt;br&gt;🚇 &lt;a href="https://github.com/nomi9995/react-native-bottomsheet-reanimated/commits?author=nomi9995" title="Code"&gt;💻&lt;/a&gt;
&lt;/td&gt;
  &lt;/tr&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;If you really learned something new with this article, save it and share it with your colleagues.&lt;/p&gt;

&lt;p&gt;You can reach me out on my website: &lt;br&gt;
&lt;a href="https://numan.dev"&gt;https://numan.dev&lt;/a&gt;&lt;/p&gt;

</description>
      <category>reactnative</category>
      <category>componentsplitter</category>
      <category>divide</category>
      <category>split</category>
    </item>
    <item>
      <title>What's new in React 18 ?</title>
      <dc:creator>Numan</dc:creator>
      <pubDate>Mon, 23 Aug 2021 11:15:32 +0000</pubDate>
      <link>https://dev.to/numandev1/what-s-new-in-react-18-4a7j</link>
      <guid>https://dev.to/numandev1/what-s-new-in-react-18-4a7j</guid>
      <description>&lt;p&gt;While there is still a lot more to come, I thought may be fascinating to share its top new features.&lt;/p&gt;

&lt;h3&gt;
  
  
  Automatic batching
&lt;/h3&gt;

&lt;p&gt;Batching in React is whenever multiple state updates are combined into a single re-render.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight jsx"&gt;&lt;code&gt;&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nx"&gt;App&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;count&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;setCount&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;useState&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;flag&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;setFlag&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;useState&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kc"&gt;false&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

  &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nx"&gt;handleClick&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nx"&gt;setCount&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;c&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nx"&gt;c&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="c1"&gt;// Does not re-render yet&lt;/span&gt;
    &lt;span class="nx"&gt;setFlag&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;f&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="nx"&gt;f&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="c1"&gt;// Does not re-render yet&lt;/span&gt;

    &lt;span class="c1"&gt;// React will only re-render once at the end (that's batching!)&lt;/span&gt;

  &lt;span class="p"&gt;}&lt;/span&gt;

  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;div&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
      &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;button&lt;/span&gt; &lt;span class="na"&gt;onClick&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;handleClick&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;Next&lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nt"&gt;button&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
      &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;h1&lt;/span&gt; &lt;span class="na"&gt;style&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;flag&lt;/span&gt; &lt;span class="p"&gt;?&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;blue&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;black&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;count&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nt"&gt;h1&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nt"&gt;div&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
  &lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In this example, the component would only be rendered once after &lt;strong&gt;handleClick&lt;/strong&gt; is called, Although we might think &lt;strong&gt;setCount&lt;/strong&gt; and &lt;strong&gt;setClicked&lt;/strong&gt; would trigger two re-renders.&lt;/p&gt;

&lt;p&gt;Now, while this works well at the moment, &lt;/p&gt;

&lt;p&gt;if you’re calling multiple state updates in a different context such as &lt;strong&gt;a promise&lt;/strong&gt; or &lt;strong&gt;a callback.&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight jsx"&gt;&lt;code&gt;&lt;span class="c1"&gt;// Promise&lt;/span&gt;
&lt;span class="nx"&gt;fetchSomething&lt;/span&gt;&lt;span class="p"&gt;().&lt;/span&gt;&lt;span class="nx"&gt;then&lt;/span&gt;&lt;span class="p"&gt;(()&lt;/span&gt;&lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nx"&gt;setCount&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;count&lt;/span&gt;&lt;span class="o"&gt;+&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="nx"&gt;setFlag&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;})&lt;/span&gt;

&lt;span class="c1"&gt;//callback or timeout&lt;/span&gt;
&lt;span class="nx"&gt;setTimeOut&lt;/span&gt;&lt;span class="p"&gt;(()&lt;/span&gt;&lt;span class="o"&gt;=&amp;gt;&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nx"&gt;setCount&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;count&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="nx"&gt;setFlag&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;})&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;React won’t batch these two updates into one and you’ll get two re-renders when only one would have been needed.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;With React 18, all these use-cases will now be covered and state updates will be batched automatically no matter what’s the context.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight jsx"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;unstable_batchedUpdates&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;react-dom&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="nx"&gt;unstable_batchedUpdates&lt;/span&gt;&lt;span class="p"&gt;(()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nx"&gt;setCount&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;count&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="nx"&gt;setFlag&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;})&lt;/span&gt;

&lt;span class="c1"&gt;//React 18 will do it for you by default. &lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This might remind you of &lt;strong&gt;unstable_batchedUpdates&lt;/strong&gt; that was doing exactly this, well now, React will do it for you by default.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;How to stop batching ?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;If you happen not to want these updates to be batched, you’ll need to use &lt;strong&gt;flushSync&lt;/strong&gt; that will re-render your component every time it’s done running the function you’re passing it to.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight jsx"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;flushSync&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;react-dom&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nx"&gt;handleClick&lt;/span&gt;&lt;span class="p"&gt;(){&lt;/span&gt;
    &lt;span class="nx"&gt;flushSync&lt;/span&gt;&lt;span class="p"&gt;(()&lt;/span&gt;&lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
            &lt;span class="nx"&gt;setCount&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;count&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="p"&gt;});&lt;/span&gt;
    &lt;span class="c1"&gt;// React has re-render&lt;/span&gt;

    &lt;span class="nx"&gt;flushSync&lt;/span&gt;&lt;span class="p"&gt;(()&lt;/span&gt;&lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
            &lt;span class="nx"&gt;setFlag&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="p"&gt;});&lt;/span&gt;
    &lt;span class="c1"&gt;// React will re-render&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;So with the following, your component would render twice instead of just one time.&lt;/p&gt;

&lt;h3&gt;
  
  
  Transitions
&lt;/h3&gt;

&lt;p&gt;A really big new feature, which allows you “to tell React &lt;strong&gt;which updates are urgent, and which are not&lt;/strong&gt;”.&lt;/p&gt;

&lt;p&gt;A good example of that is a search input that should filter out a list of elements.&lt;/p&gt;

&lt;p&gt;So if you’re updating a search input, you’d want its value to change as we type, Although the search results might appear in a second&lt;/p&gt;

&lt;p&gt;phase when we’re done typing.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight jsx"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;startTransition&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;react&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="c1"&gt;//Urgent : Update input value as type&lt;/span&gt;
&lt;span class="nx"&gt;setInputValue&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;input&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="nx"&gt;startTransition&lt;/span&gt;&lt;span class="p"&gt;(()&lt;/span&gt;&lt;span class="o"&gt;=&amp;gt;&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="c1"&gt;//Secondary: Show the search results&lt;/span&gt;
    &lt;span class="nx"&gt;setSearchQuery&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;input&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;});&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This is where we could mark the input value change as an urgent update, and the elements filtering as secondary also called now a transition.&lt;/p&gt;

&lt;p&gt;Transitions can be interrupted by urgent updates and previous transitions that are no longer relevant will be dismissed.&lt;/p&gt;

&lt;p&gt;This allows the user interface to only show its most up-to-date state and skip secondary updates, transitions, that might be slower&lt;/p&gt;

&lt;p&gt;to compute and sometimes return intermediate states that are irrelevant.&lt;/p&gt;

&lt;p&gt;As you can see here, we’re marking the input value change as urgent, and run our secondary update inside a transition as it might trigger slow computations and could freeze or slow down the whole user experience as we type.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;startTransition&lt;/strong&gt; is great for any update “you want to move to the background” such as slow and complex rendering tasks or when&lt;/p&gt;

&lt;p&gt;updates rely on fetching data that might take time due to a slow network.&lt;/p&gt;

&lt;h3&gt;
  
  
  Suspense and Server-Side Rendering
&lt;/h3&gt;

&lt;p&gt;The way SSR ( Server side rendering ) works is by rendering all the&lt;/p&gt;

&lt;p&gt;components on the server first, then sending the result as HTML to the browser.&lt;/p&gt;

&lt;p&gt;After that, the JavaScript is loaded as usual and the HTML magically becomes interactive by what is called hydration.&lt;/p&gt;

&lt;p&gt;This turns your static HTML elements into your dynamic React components as you know them.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Problem?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The main problem with this approach is that as long as the JavaScript hasn’t been fetched, loaded, and your HTML hydrated, your page won’t be interactive.&lt;/p&gt;

&lt;p&gt;To solve this waterfall issue, React 18 now offers two new features for SSR: &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Streaming HTML and Selective Hydration&lt;/strong&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Streaming HTML
&lt;/h3&gt;

&lt;p&gt;Streaming HTML means that the server can send pieces of your components as they get rendered.&lt;/p&gt;

&lt;p&gt;This works by using Suspense, where you’d say which parts of your application will take longer to load and which ones should be rendered directly.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight jsx"&gt;&lt;code&gt;&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;Page&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;Article&lt;/span&gt; &lt;span class="p"&gt;/&amp;gt;&lt;/span&gt;
    &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;Suspense&lt;/span&gt; &lt;span class="na"&gt;fallback&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;Loader&lt;/span&gt; &lt;span class="p"&gt;/&amp;gt;&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
         &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;Comments&lt;/span&gt; &lt;span class="p"&gt;/&amp;gt;&lt;/span&gt;   
    &lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nc"&gt;Suspense&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
&lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nc"&gt;Page&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If you think of an article with comments where the article is the critical part of the page, you could say load the article but don’t&lt;/p&gt;

&lt;p&gt;wait for the comments to be ready to send HTML to the browser.&lt;/p&gt;

&lt;p&gt;You could show a spinner instead using &lt;strong&gt;Suspense&lt;/strong&gt; and once the comments are ready,&lt;/p&gt;

&lt;p&gt;React will send new bits of HTML that will replace the spinner in place.&lt;/p&gt;

&lt;h3&gt;
  
  
  Selective hydration
&lt;/h3&gt;

&lt;p&gt;Selective hydration is awesome.&lt;/p&gt;

&lt;p&gt;Where before you’d have to wait for every component to be rendered to begin hydration, but now components wrapped with Suspense won’t block hydration anymore.&lt;/p&gt;

&lt;p&gt;if we go back to our article page, the comments that we wrapped with Suspense won’t block the article and other components to be hydrated.&lt;/p&gt;

&lt;p&gt;Every ready component will start hydrating and the comments will too, once the browser gets both its content and JavaScript code.&lt;/p&gt;

&lt;p&gt;The most important feature of selective hydration&lt;/p&gt;

&lt;p&gt;is that if you happen to interact with one of the components before it’s been fully hydrated, meaning you click somewhere, for example, React will prioritize this component’s hydration.&lt;/p&gt;

&lt;p&gt;This ensures that the most critical interactions are to be repeated as soon as we can hydrate the related component, making sure it’s&lt;/p&gt;

&lt;p&gt;hydrated before the others.&lt;/p&gt;

&lt;p&gt;Thank you for reading. &lt;/p&gt;

&lt;p&gt;If you really learned something new with this article, save it and share it with your colleagues.&lt;/p&gt;

&lt;p&gt;You can reach me out on my website: &lt;br&gt;
&lt;a href="https://numan.dev"&gt;https://numan.dev&lt;/a&gt;&lt;/p&gt;

</description>
      <category>react</category>
      <category>reactnative</category>
      <category>javascript</category>
      <category>react18</category>
    </item>
    <item>
      <title>react-native-bottomsheet-reanimated</title>
      <dc:creator>Numan</dc:creator>
      <pubDate>Sun, 12 Jul 2020 07:27:14 +0000</pubDate>
      <link>https://dev.to/numandev1/react-native-bottomsheet-reanimated-20op</link>
      <guid>https://dev.to/numandev1/react-native-bottomsheet-reanimated-20op</guid>
      <description>&lt;h1&gt;
  
  
  react-native-bottomsheet-reanimated
&lt;/h1&gt;

&lt;p&gt;Highly configurable component imitating &lt;a href="https://material.io/design/components/sheets-bottom.html#standard-bottom-sheet"&gt;native bottom sheet behavior&lt;/a&gt;, with fully native 60 FPS animations!&lt;/p&gt;

&lt;p&gt;Built from scratch with &lt;a href="https://www.npmjs.com/package/react-native-interactable-reanimted"&gt;react-native-interactable-reanimted&lt;/a&gt; and &lt;a href="https://github.com/kmagiera/react-native-reanimated"&gt;react-native-reanimated&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Usable with Expo with no extra native dependencies!&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--ATuMp9Bt--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://raw.githubusercontent.com/nomi9995/react-native-bottomsheet-reanimated/master/media/bottom1.gif" alt=""&gt;&lt;/th&gt;
&lt;th&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Tad-AZC3--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://raw.githubusercontent.com/nomi9995/react-native-bottomsheet-reanimated/master/media/bottom2.gif" alt=""&gt;&lt;/th&gt;
&lt;th&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--pa-uuEON--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://raw.githubusercontent.com/nomi9995/react-native-bottomsheet-reanimated/master/media/bottom3.gif" alt=""&gt;&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h2&gt;
  
  
  Installation
&lt;/h2&gt;

&lt;p&gt;Open a Terminal in the project root and run:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;yarn add react-native-bottomsheet-reanimated
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;or if you use &lt;code&gt;npm&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npm &lt;span class="nb"&gt;install &lt;/span&gt;react-native-bottomsheet-reanimated
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If you are using Expo, you are done.&lt;/p&gt;

&lt;p&gt;If you don't use Expo, install and link &lt;a href="https://kmagiera.github.io/react-native-gesture-handler/docs/getting-started.html"&gt;react-native-gesture-handler&lt;/a&gt; and &lt;a href="https://github.com/kmagiera/react-native-reanimated"&gt;react-native-reanimated&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Usage
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nx"&gt;BottomSheet&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;react-native-bottomsheet-reanimated&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;class&lt;/span&gt; &lt;span class="nx"&gt;Example&lt;/span&gt; &lt;span class="kd"&gt;extends&lt;/span&gt; &lt;span class="nx"&gt;React&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;Component&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;

  &lt;span class="nx"&gt;render&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;
      &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;View&lt;/span&gt; &lt;span class="nx"&gt;style&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;styles&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;container&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
        &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;BottomSheet&lt;/span&gt;
          &lt;span class="nx"&gt;bottomSheerColor&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;#FFFFFF&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;
          &lt;span class="c1"&gt;// backDropColor="red"&lt;/span&gt;
          &lt;span class="nx"&gt;ref&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;BottomSheet&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;
          &lt;span class="nx"&gt;initialPosition&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;50%&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;  &lt;span class="c1"&gt;//200, 300&lt;/span&gt;
          &lt;span class="nx"&gt;snapPoints&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;snapPoints&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;
          &lt;span class="nx"&gt;isBackDrop&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;
          &lt;span class="nx"&gt;isBackDropDismisByPress&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;
          &lt;span class="nx"&gt;isRoundBorderWithTipHeader&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;
          &lt;span class="c1"&gt;// isModal&lt;/span&gt;
          &lt;span class="c1"&gt;// containerStyle={{backgroundColor:"red"}}&lt;/span&gt;
          &lt;span class="c1"&gt;// tipStyle={{backgroundColor:"red"}}&lt;/span&gt;
          &lt;span class="c1"&gt;// headerStyle={{backgroundColor:"red"}}&lt;/span&gt;
          &lt;span class="c1"&gt;// bodyStyle={{backgroundColor:"red",flex:1}}&lt;/span&gt;
          &lt;span class="nx"&gt;header&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;
            &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;View&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
              &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;Text&lt;/span&gt; &lt;span class="nx"&gt;style&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;styles&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;text&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="nx"&gt;Header&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/Text&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;            &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/View&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;          &lt;span class="p"&gt;}&lt;/span&gt;
          &lt;span class="nx"&gt;body&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;
            &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;View&lt;/span&gt; &lt;span class="nx"&gt;style&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;styles&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;body&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
              &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;Text&lt;/span&gt; &lt;span class="nx"&gt;style&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;styles&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;text&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="nx"&gt;Body&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/Text&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;            &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/View&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;          &lt;span class="p"&gt;}&lt;/span&gt;
        &lt;span class="sr"&gt;/&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;    &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/View&amp;gt;&lt;/span&gt;&lt;span class="err"&gt;)
&lt;/span&gt;  &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Props
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;name&lt;/th&gt;
&lt;th&gt;required&lt;/th&gt;
&lt;th&gt;default&lt;/th&gt;
&lt;th&gt;description&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;snapPoints&lt;/td&gt;
&lt;td&gt;yes&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;E.g. &lt;code&gt;[300, 200, 0]&lt;/code&gt;. Points for snapping of bottom sheet coomponent. They define distance from bottom of the screen. Might be number or percent (as string e.g. &lt;code&gt;'20%'&lt;/code&gt;) for points or percents of screen height from bottom. Note: Array values must be in descending order.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;initialPosition&lt;/td&gt;
&lt;td&gt;no&lt;/td&gt;
&lt;td&gt;0&lt;/td&gt;
&lt;td&gt;Determines initial position point of bottom sheet. The value outside of snap points.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;body&lt;/td&gt;
&lt;td&gt;no&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;Method for rendering scrollable content of bottom sheet.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;header&lt;/td&gt;
&lt;td&gt;no&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;Method for rendering non-scrollable header of bottom sheet.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;isBackDrop&lt;/td&gt;
&lt;td&gt;no&lt;/td&gt;
&lt;td&gt;&lt;code&gt;false&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;for show backdrop behind the bottom sheet.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;isBackDropDismisByPress&lt;/td&gt;
&lt;td&gt;no&lt;/td&gt;
&lt;td&gt;&lt;code&gt;false&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;enable to move bottomsheet to first snappoint by pressing backdrop.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;isRoundBorderWithTipHeader&lt;/td&gt;
&lt;td&gt;no&lt;/td&gt;
&lt;td&gt;&lt;code&gt;false&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;give round with tip header style to bottomsheet.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;isModal&lt;/td&gt;
&lt;td&gt;no&lt;/td&gt;
&lt;td&gt;&lt;code&gt;false&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;to make bottom sheet like modal.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;isAnimatedYFromParent&lt;/td&gt;
&lt;td&gt;no&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;If &lt;code&gt;true&lt;/code&gt; then give animated value to &lt;code&gt;animatedValueY&lt;/code&gt; props.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;animatedValueY&lt;/td&gt;
&lt;td&gt;no&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;If isAnimatedYFromParent will be &lt;code&gt;true&lt;/code&gt; then it will give animtedY value to &lt;code&gt;animatedValueY&lt;/code&gt; props.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;bottomSheerColor&lt;/td&gt;
&lt;td&gt;no&lt;/td&gt;
&lt;td&gt;&lt;code&gt;#ffffff&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;for background color of bottom sheet.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;tipStyle&lt;/td&gt;
&lt;td&gt;no&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;for change style of tip. it is dependted on &lt;code&gt;isRoundBorderWithTipHeader&lt;/code&gt;.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;headerStyle&lt;/td&gt;
&lt;td&gt;no&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;for change style of header.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;bodyStyle&lt;/td&gt;
&lt;td&gt;no&lt;/td&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;for change style of body.&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h2&gt;
  
  
  Methods
&lt;/h2&gt;

&lt;h3&gt;
  
  
  &lt;code&gt;snapTo(index)&lt;/code&gt;
&lt;/h3&gt;

&lt;p&gt;Imperative method on for snapping to snap point in given index. E.g.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="c1"&gt;// Snap to the snap point at index 0 (e.g. 450 in [450, 300, 0])&lt;/span&gt;
&lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;refs&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;BottomSheet&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;current&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;snapTo&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;9&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Here &lt;code&gt;this.refs.BottomSheet&lt;/code&gt; refers &lt;a href="https://reactjs.org/docs/react-api.html#reactcreateref"&gt;to the &lt;code&gt;ref&lt;/code&gt;&lt;/a&gt; passed to the &lt;code&gt;BottomSheet&lt;/code&gt; component.&lt;/p&gt;

&lt;h2&gt;
  
  
  Example
&lt;/h2&gt;

&lt;p&gt;More complex examples can be found in the &lt;code&gt;Example&lt;/code&gt; folder. To view the examples in the &lt;a href="https://expo.io/"&gt;Expo app&lt;/a&gt;, open a Terminal and run:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;yarn
&lt;span class="nb"&gt;cd &lt;/span&gt;Example
yarn
expo start
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
      <category>react</category>
      <category>bottomsheet</category>
      <category>reactnative</category>
    </item>
    <item>
      <title>Make Tangible symlinks (npm)</title>
      <dc:creator>Numan</dc:creator>
      <pubDate>Sun, 28 Jun 2020 19:19:23 +0000</pubDate>
      <link>https://dev.to/numandev1/mtsl-make-tangible-symlinks-npm-2ec4</link>
      <guid>https://dev.to/numandev1/mtsl-make-tangible-symlinks-npm-2ec4</guid>
      <description>&lt;p&gt;I have made CLI for make Tangible symlinks.&lt;br&gt;
&lt;a href="https://www.npmjs.com/package/mtsl"&gt;https://www.npmjs.com/package/mtsl&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;
  &lt;a href="https://i.giphy.com/media/h4rDG45HDghxqzw5fF/giphy.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://i.giphy.com/media/h4rDG45HDghxqzw5fF/giphy.gif"&gt;&lt;/a&gt;
&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Make Tangible symlinks&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Mtsl listens to changes in some folder (using &lt;a href="https://www.npmjs.com/package/chokidar"&gt;Chokidar&lt;/a&gt;) and copies changed files into another folder.&lt;/p&gt;

&lt;h2&gt;
  
  
  Working
&lt;/h2&gt;

&lt;p&gt;Actually, it is watcher &lt;strong&gt;CLI&lt;/strong&gt; that copy files from source to destination&lt;/p&gt;

&lt;h2&gt;
  
  
  Why Mtsl not other packages?
&lt;/h2&gt;

&lt;p&gt;There are other tangible symlink packages available but every package has so many bugs. famous package is &lt;a href="https://github.com/wix/wml"&gt;wml&lt;/a&gt; but that have many bugs. This package is working as required&lt;/p&gt;

&lt;p&gt;Let's face it, sometimes symbolic links just aren't enough. Github has more than &lt;a href="https://github.com/search?utf8=%E2%9C%93&amp;amp;q=support+for+symlinks&amp;amp;type=Issues"&gt;80K issues&lt;/a&gt; with the words "support for symlinks" in them. &lt;/p&gt;

&lt;p&gt;Mtsl is a CLI tool that works pretty much like &lt;code&gt;ln -s [src] [dest]&lt;/code&gt;. You first set up your links by using the &lt;code&gt;mtsl add -s [src] -d [dest]&lt;/code&gt; command and then run the mtsl service (&lt;code&gt;mtsl start &amp;lt;linkId&amp;gt;&lt;/code&gt;) to start listening. link index can be get from &lt;code&gt;mtsl list&lt;/code&gt; That's it!&lt;/p&gt;

&lt;p&gt;Note that since Mtsl is based on Chokidar it &lt;strong&gt;does not support symlinks&lt;/strong&gt;. lol.&lt;/p&gt;

&lt;h2&gt;
  
  
  Install
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npm &lt;span class="nb"&gt;install&lt;/span&gt; &lt;span class="nt"&gt;-g&lt;/span&gt; mtsl
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Usage
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# add the link to mtsl using `mtsl add -s &amp;lt;src&amp;gt; -d &amp;lt;dest&amp;gt;`&lt;/span&gt;
mtsl add &lt;span class="nt"&gt;-s&lt;/span&gt; ~/source-dir &lt;span class="nt"&gt;-d&lt;/span&gt; ~/User/destination-dir
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h6&gt;
  
  
  output
&lt;/h6&gt;

&lt;p&gt;Added link: (0) /Users/username/source-dir -&amp;gt; /Users/username/User/destination-dir&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# above command will give you link id what will use to start watching link that is added
mtsl start 0
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  OR
&lt;/h2&gt;

&lt;p&gt;make start symlink without add link&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# it is same as `mtsl start` but it starts to make symlink without adding the link&lt;/span&gt;
mtsl startwithoutadd &lt;span class="nt"&gt;-s&lt;/span&gt; &amp;lt;src&amp;gt; &lt;span class="nt"&gt;-d&lt;/span&gt; &amp;lt;dest&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;&lt;br&gt;
`&lt;/p&gt;

&lt;h2&gt;
  
  
  Commands
&lt;/h2&gt;

&lt;h4&gt;
  
  
  add
&lt;/h4&gt;

&lt;p&gt;&lt;code&gt;mtsl add -s &amp;lt;src&amp;gt; -d &amp;lt;dest&amp;gt;&lt;/code&gt; &lt;br&gt;
(or &lt;code&gt;mtsl add -s &amp;lt;src&amp;gt; -d &amp;lt;dest&amp;gt; -skip-prompt&lt;/code&gt;)&lt;/p&gt;

&lt;p&gt;Adds a link.&lt;/p&gt;

&lt;p&gt;mtsl will not start listening to changes until you start it by running &lt;code&gt;mtsl start &amp;lt;linkId&amp;gt;&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Each link is given an unique id, you can see all links and their ids by running &lt;code&gt;mtsl list&lt;/code&gt;.&lt;br&gt;
Links are saved to &lt;code&gt;src/links.json&lt;/code&gt; in your &lt;code&gt;mtsl&lt;/code&gt; install directory, meaning that &lt;br&gt;
your configuration is specific to that &lt;code&gt;mtsl&lt;/code&gt; install.&lt;/p&gt;

&lt;h4&gt;
  
  
  remove
&lt;/h4&gt;

&lt;p&gt;&lt;code&gt;mtsl remove &amp;lt;linkId&amp;gt;&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Removes a link.&lt;/p&gt;

&lt;h4&gt;
  
  
  remove all
&lt;/h4&gt;

&lt;p&gt;&lt;code&gt;mtsl removeall&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Removes all link that made by using &lt;code&gt;mtsl add&lt;/code&gt;.&lt;/p&gt;

&lt;h4&gt;
  
  
  start
&lt;/h4&gt;

&lt;p&gt;&lt;code&gt;mtsl start &amp;lt;linkId&amp;gt;&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Starts mtsl.&lt;/p&gt;

&lt;p&gt;It first copies all watched files from source to destination folder and then waits for new changes to happen.&lt;/p&gt;

&lt;h4&gt;
  
  
  startwithoutadd
&lt;/h4&gt;

&lt;p&gt;&lt;code&gt;mtsl startwithoutadd -s &amp;lt;src&amp;gt; -d &amp;lt;dest&amp;gt;&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Starts mtsl without add link.&lt;/p&gt;

&lt;p&gt;it is same as &lt;code&gt;mtsl start&lt;/code&gt; but it starts to make symlink without adding the link.&lt;/p&gt;

&lt;h4&gt;
  
  
  list
&lt;/h4&gt;

&lt;p&gt;&lt;code&gt;mtsl list&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Lists all links.&lt;/p&gt;

&lt;p&gt;Shows each link's id and source/destination folders.&lt;/p&gt;

&lt;h2&gt;
  
  
  Miscellaneous
&lt;/h2&gt;

&lt;h4&gt;
  
  
  Ignored folders
&lt;/h4&gt;

&lt;p&gt;When adding a new link Mtsl will try to detect if your source folder is a git repository or an npm package, it will then offer to ignore the ".git" and "node_modules" folders for you.&lt;/p&gt;

&lt;p&gt;If you want to add more folders to your ignored folders first create a file named &lt;code&gt;.mtslconfig.json&lt;/code&gt; in your source folder, this file should contain ignore directories for this folder which will not &lt;a href="https://en.wikipedia.org/wiki/Create,_read,_update_and_delete"&gt;CRUD&lt;/a&gt; from source to destination.&lt;/p&gt;

&lt;p&gt;In the following example we are ignoring the ".git" and "node_modules" folders:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;&lt;/code&gt;&lt;code&gt;json&lt;br&gt;
{&lt;br&gt;
    "ignore_dirs": [&lt;br&gt;
        ".git",&lt;br&gt;
        "node_modules"&lt;br&gt;
    ]&lt;br&gt;
}&lt;br&gt;
&lt;/code&gt;&lt;code&gt;&lt;/code&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Contributing
&lt;/h2&gt;

&lt;p&gt;See the &lt;a href="https://github.com/nomi9995/mtsl/blob/master/CONTRIBUTING.md"&gt;Contributing page&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>tangible</category>
      <category>symlink</category>
      <category>symlinks</category>
      <category>tangiblesymlink</category>
    </item>
    <item>
      <title>create expo library (npm)</title>
      <dc:creator>Numan</dc:creator>
      <pubDate>Sun, 28 Jun 2020 19:14:42 +0000</pubDate>
      <link>https://dev.to/numandev1/create-expo-library-3ghl</link>
      <guid>https://dev.to/numandev1/create-expo-library-3ghl</guid>
      <description>&lt;p&gt;I have made CLI for create expo library.&lt;br&gt;
&lt;a href="https://www.npmjs.com/package/expo-library"&gt;https://www.npmjs.com/package/expo-library&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--spd1Jr6_--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/4e8k4ndnyrj0e38wboog.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--spd1Jr6_--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/4e8k4ndnyrj0e38wboog.gif" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  Install globally
&lt;/h2&gt;

&lt;p&gt;This package requires &lt;code&gt;node &amp;gt;= 10&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;install &lt;code&gt;expo-library&lt;/code&gt; by&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npm &lt;span class="nb"&gt;install&lt;/span&gt; &lt;span class="nt"&gt;-g&lt;/span&gt; expo-library
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Creating a New Library
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;expo-library
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Answer some basic prompts about your module, and then the CLI will perform the following steps:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;copy over the template&lt;/li&gt;
&lt;li&gt;install dependencies via yarn or npm&lt;/li&gt;
&lt;li&gt;link packages together for local development&lt;/li&gt;
&lt;li&gt;initialize local git repo&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Development
&lt;/h2&gt;

&lt;p&gt;Local development is broken into two parts (ideally using two tabs).&lt;/p&gt;

&lt;p&gt;First, go to &lt;code&gt;root&lt;/code&gt; dir of newly create library and edit component in index.js/ts file.&lt;/p&gt;

&lt;p&gt;Second, go to &lt;code&gt;example/&lt;/code&gt; dir and run metro bundle by&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;cd &lt;/span&gt;example
npm start &lt;span class="c"&gt;# runs your expo app bundler&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now, anytime you make a change to your library in &lt;code&gt;index.js&lt;/code&gt; or to the example app's &lt;code&gt;example/App.js&lt;/code&gt; will fresh refresh component in example.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://i.giphy.com/media/14udF3WUwwGMaA/giphy.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://i.giphy.com/media/14udF3WUwwGMaA/giphy.gif" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h4&gt;
  
  
  Publishing to npm
&lt;/h4&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npm publish
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Make sure that any npm modules you want as peer dependencies are properly marked as &lt;code&gt;peerDependencies&lt;/code&gt; in &lt;code&gt;package.json&lt;/code&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Contributing
&lt;/h2&gt;

&lt;p&gt;See the &lt;a href="https://github.com/nomi9995/expo-library/blob/master/CONTRIBUTING.md"&gt;Contributing page&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>expo</category>
      <category>library</category>
      <category>reactnative</category>
      <category>package</category>
    </item>
  </channel>
</rss>
