<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Rahul Tingare on Medium]]></title>
        <description><![CDATA[Stories by Rahul Tingare on Medium]]></description>
        <link>https://medium.com/@rahultingare1999?source=rss-d20b01f2671b------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*7H-nC-u7WmsgTvHI</url>
            <title>Stories by Rahul Tingare on Medium</title>
            <link>https://medium.com/@rahultingare1999?source=rss-d20b01f2671b------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 06 Dec 2026 16:34:18 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@rahultingare1999/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[How to use Nativewind(Tailwindcss) in your react-native application in 2024]]></title>
            <link>https://medium.com/@rahultingare1999/how-to-use-nativewind-tailwindcss-in-your-react-native-application-in-2024-4cd666d418d7?source=rss-d20b01f2671b------2</link>
            <guid isPermaLink="false">https://medium.com/p/4cd666d418d7</guid>
            <category><![CDATA[nativewind]]></category>
            <category><![CDATA[react-native]]></category>
            <dc:creator><![CDATA[Rahul Tingare]]></dc:creator>
            <pubDate>Thu, 13 Jun 2024 11:53:31 GMT</pubDate>
            <atom:updated>2024-06-13T11:53:31.102Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/293/1*ziBVHdjAkeDhtFn1CwvSfQ.jpeg" /></figure><p>Utilizing NativeWind with React Native is an effortless process, but make sure that you meet these prerequisites before delving into this blog.</p><ol><li>Your react-native app should have been created using Expo and not react-native CLI . For react-native CLI,refer to other resources.</li><li>This code will be relevant for Expo SDK 48.</li><li>You should be familiar with Tailwindcss.</li></ol><p>After making sure you meet the above requirements,Follow the below steps or you can simply Copy and paste the code snippets i am sharing to use Nativewind in your project.</p><ol><li>Install nativewind and its dependencies.</li></ol><pre>yarn add nativewind <br>yarn add --dev tailwindcss</pre><p>or if you are using NPM instead of Yarn</p><pre>npm install nativewind<br>npm install --save-dev tailwindcss</pre><p>2. Run npx tailwindcss init to create a tailwind.config.js file</p><p>3. Replace the existing code in tailwind.config.js file with the code given below.</p><pre>// tailwind.config.js<br><br>module.exports = {<br>  content: [&quot;./App.{js,jsx,ts,tsx}&quot;, &quot;./&lt;custom directory&gt;/**/*.{js,jsx,ts,tsx}&quot;],<br>  theme: {<br>    extend: {},<br>  },<br>  plugins: [],<br>}</pre><p>4. Obviously, you might be creating other folders too which would be having React-native components in them. The code above will not apply Tailwindcss to all of them. To do so, you will have to add the custom folder name in tailwind.config.js . For eg. if you create a folder called “screens”, to make sure Tailwind classes are applicable to each file inside the folder “screens”, add the folder’s name in place of “&lt;custom directory&gt;” written in tailwind.config.js. You can add as many custom paths as you would like to.</p><pre>// tailwind.config.js<br><br>module.exports = {<br>  content: [&quot;./App.{js,jsx,ts,tsx}&quot;, &quot;./screens/**/*.{js,jsx,ts,tsx}&quot;],<br>  theme: {<br>    extend: {},<br>  },<br>  plugins: [],<br>}</pre><p>5. Final step! In your babel.config.js add this line</p><p><strong>plugins: [“nativewind/babel”],</strong></p><pre>// babel.config.js<br>module.exports = function (api) {<br>  api.cache(true);<br>  return {<br>    presets: [&quot;babel-preset-expo&quot;],<br>+   plugins: [&quot;nativewind/babel&quot;],<br>  };<br>};</pre><p>THAT’S IT !!! you are good to go. Now you can start using Tailwindcss classes in your react-native project too!!! you can also refer to docs by going on <a href="https://www.nativewind.dev/quick-starts/expo">this </a>link.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4cd666d418d7" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Learn the useState React Hook]]></title>
            <link>https://medium.com/@rahultingare1999/learn-the-usestate-react-hook-58d4ab136048?source=rss-d20b01f2671b------2</link>
            <guid isPermaLink="false">https://medium.com/p/58d4ab136048</guid>
            <dc:creator><![CDATA[Rahul Tingare]]></dc:creator>
            <pubDate>Thu, 23 Nov 2023 10:05:54 GMT</pubDate>
            <atom:updated>2023-11-23T10:16:08.209Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/720/1*uZK6ULAOcirDwCAPjvwmWw.png" /><figcaption>earn to use useState in your functional components.</figcaption></figure><p><strong>What is useState?</strong></p><p>React’s built-in useState hook lets functional components control and modify their own state. Prior to hooks, state management was only possible in class components using the setState method. UseState, on the other hand, offers a clearer and more straightforward method for managing state in functional components.</p><p><strong>Basic Syntax</strong></p><p>The basic syntax of useState is straightforward:</p><pre>import React, { useState } from &#39;react&#39;;<br><br>function MyComponent() {<br>  // Declare a state variable and its initial value<br>const stateArray= useState(initialValue);<br>  const [state, setState] = stateArray;<br>// you can write standard way in one line<br>const [state, setState] = useState(initialValue);<br><br>  // JSX and component rendering...<br>}</pre><ul><li>useState is imported from the react library.</li><li>initialValue is the initial value of the state variable.</li></ul><p>The function useState returns an array containing two elements:</p><ol><li>state: The current value of the state variable.</li><li>setState: A function used to update the state variable.</li></ol><p><strong>Why is useState Important?</strong></p><ol><li><strong>Simplified State Management: </strong>Before hooks, managing state in functional components was challenging. Developers often resorted to using workarounds like prop drilling or state management libraries like Redux. useState simplifies this process by allowing you to manage component-specific state within functional components.</li><li><strong>Cleaner Code:</strong> With useState, you can write cleaner and more concise code. You don&#39;t need to write constructor functions or class methods to manage state. Instead, you declare your state variable directly within your functional component.</li><li><strong>Improved Readability:</strong> Functional components are easier to read and understand. They focus on rendering UI and handling logic, making your codebase more maintainable.</li></ol><p><strong>Use Case of useState: </strong>Let’s explore the practical use of useState with some examples.</p><ol><li><strong>Example 1: Managing a Counter</strong></li></ol><pre>import React, { useState } from &#39;react&#39;;<br><br>function Counter() {<br>  const [count, setCount] = useState(0);<br><br>  return (<br>    &lt;div&gt;<br>      &lt;p&gt;Count: {count}&lt;/p&gt;<br>      &lt;button onClick={() =&gt; setCount(count + 1)}&gt;Increment&lt;/button&gt;<br>      &lt;button onClick={() =&gt; setCount(count - 1)}&gt;Decrement&lt;/button&gt;<br>    &lt;/div&gt;<br>  );<br>}</pre><p>In this example, we declare a count state variable and initialize it to 0. We use the setCount function to update its value when the buttons are clicked.</p><p>appy Learning! Feel free to connect with me o<a href="https://www.linkedin.com/in/rahultingare/">nLinkedIn!</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=58d4ab136048" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>