<?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: horace njoroge</title>
    <description>The latest articles on DEV Community by horace njoroge (@horace_njoroge_261c15ddae).</description>
    <link>https://dev.to/horace_njoroge_261c15ddae</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%2F1502209%2Fe2b35d02-e254-4310-a5d0-17368c97d21e.png</url>
      <title>DEV Community: horace njoroge</title>
      <link>https://dev.to/horace_njoroge_261c15ddae</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/horace_njoroge_261c15ddae"/>
    <language>en</language>
    <item>
      <title>Understanding and Resolving Node.js Version Conflicts with NVM on macOS</title>
      <dc:creator>horace njoroge</dc:creator>
      <pubDate>Fri, 04 Oct 2024 00:32:53 +0000</pubDate>
      <link>https://dev.to/horace_njoroge_261c15ddae/understanding-and-resolving-nodejs-version-conflicts-with-nvm-on-macos-3a32</link>
      <guid>https://dev.to/horace_njoroge_261c15ddae/understanding-and-resolving-nodejs-version-conflicts-with-nvm-on-macos-3a32</guid>
      <description>&lt;p&gt;Node.js version conflicts can arise when multiple versions are installed, causing discrepancies in development environments. Here’s how to manage Node.js versions effectively using Node Version Manager (NVM):&lt;/p&gt;

&lt;p&gt;First, if NVM is not installed, you can set it up with this command:&lt;/p&gt;

&lt;p&gt;bash&lt;br&gt;
Copy code&lt;br&gt;
curl -o- &lt;a href="https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.5/install.sh" rel="noopener noreferrer"&gt;https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.5/install.sh&lt;/a&gt; | bash&lt;br&gt;
Next, check installed Node.js versions with:&lt;/p&gt;

&lt;p&gt;bash&lt;br&gt;
Copy code&lt;br&gt;
nvm ls&lt;br&gt;
Switch to your desired version using:&lt;/p&gt;

&lt;p&gt;bash&lt;br&gt;
Copy code&lt;br&gt;
nvm use &lt;br&gt;
To ensure that the correct version loads automatically, edit your shell's profile file (like ~/.bash_profile or ~/.zshrc) and add:&lt;/p&gt;

&lt;p&gt;bash&lt;br&gt;
Copy code&lt;br&gt;
export NVM_DIR="$HOME/.nvm"&lt;br&gt;
[ -s "$NVM_DIR/nvm.sh" ] &amp;amp;&amp;amp; . "$NVM_DIR/nvm.sh" &lt;br&gt;
After making these changes, confirm the active Node.js version:&lt;/p&gt;

&lt;p&gt;bash&lt;br&gt;
Copy code&lt;br&gt;
node -v&lt;br&gt;
By following these steps, you can effectively manage Node.js versions and avoid compatibility issues in your projects.&lt;/p&gt;

</description>
      <category>beginners</category>
      <category>node</category>
      <category>learning</category>
      <category>development</category>
    </item>
    <item>
      <title>typescript and styling issues in react native using native wind</title>
      <dc:creator>horace njoroge</dc:creator>
      <pubDate>Fri, 28 Jun 2024 21:09:21 +0000</pubDate>
      <link>https://dev.to/horace_njoroge_261c15ddae/typescript-and-styling-issues-in-react-native-using-native-wind-4ng3</link>
      <guid>https://dev.to/horace_njoroge_261c15ddae/typescript-and-styling-issues-in-react-native-using-native-wind-4ng3</guid>
      <description>&lt;p&gt;In a recent project using React Native, I encountered several challenges related to TypeScript configuration and styling with nativewind. Here’s a summary of the issues faced and how they were successfully resolved:&lt;/p&gt;

&lt;h2&gt;
  
  
  Problem Statement:
&lt;/h2&gt;

&lt;p&gt;_**&lt;br&gt;
During development, TypeScript compiler errors (1259, 17004) surfaced due to improper module imports and JSX configuration issues. Additionally, styling React Native components using className with nativewind wasn’t functioning as expected.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Root Causes Identified:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;- Module Import Challenges:&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;TypeScript errors (1259) pointed out issues with module imports (@types/react) not being compatible with TypeScript’s default module resolution, requiring the esModuleInterop flag to be enabled.&lt;/p&gt;

&lt;p&gt;_**&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;JSX Configuration:&lt;br&gt;
*&lt;em&gt;_&lt;br&gt;
Errors (17004) highlighted JSX parsing problems because the --jsx flag was missing in the TypeScript configuration (tsconfig.json), crucial for correctly interpreting JSX syntax in React Native.&lt;br&gt;
*&lt;/em&gt;_&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Dependency Management and Setup:&lt;br&gt;
_**&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Challenges with ExpoMetroConfig.loadAsync and missing expo/tsconfig.base indicated potential version mismatches or incomplete installations of essential Expo-related packages (expo, expo-router, jest-expo).&lt;br&gt;
&lt;strong&gt;Steps Taken for Resolution:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;**_&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;TypeScript Configuration Adjustment:&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Updated tsconfig.json to include esModuleInterop: true for seamless module interoperability and set jsx: "react-native" to enable proper JSX parsing for React Native components.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Dependency Updates and Installations:&lt;/li&gt;
&lt;/ol&gt;

&lt;ul&gt;
&lt;li&gt;Ensured all dependencies (expo, expo-router, jest-expo) were updated to their latest versions to resolve specific function errors (ExpoMetroConfig.loadAsync) and ensure compatibility.&lt;/li&gt;
&lt;/ul&gt;

&lt;ol&gt;
&lt;li&gt;Project Setup and Execution:&lt;/li&gt;
&lt;/ol&gt;

&lt;ul&gt;
&lt;li&gt;Conducted thorough cleaning of npm cache, followed by reinstalling dependencies (npm install) to ensure a fresh and accurate setup, including expo@latest for comprehensive updates.
**_&lt;/li&gt;
&lt;/ul&gt;

&lt;ol&gt;
&lt;li&gt;Babel Configuration Verification:&lt;/li&gt;
&lt;/ol&gt;

&lt;ul&gt;
&lt;li&gt;Checked and updated babel.config.js to incorporate essential plugins (babel-plugin-macros) necessary for proper functionality within the Expo project environment.&lt;/li&gt;
&lt;/ul&gt;

&lt;ol&gt;
&lt;li&gt;Tailwind CSS Integration (Optional):
_**&lt;/li&gt;
&lt;/ol&gt;

&lt;ul&gt;
&lt;li&gt;Provided an example and configured tailwind.config.js to integrate Tailwind CSS utility classes (className) seamlessly with React Native components using nativewind.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;Conclusion:&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;By addressing TypeScript configuration intricacies, ensuring correct dependency management, and optimizing project setup for compatibility and functionality, the project successfully overcame initial challenges. This approach not only resolved technical hurdles but also enhanced development efficiency and maintained project integrity.&lt;/p&gt;

&lt;p&gt;This experience underscores the importance of meticulous configuration and dependency management in React Native projects, ensuring smooth integration of tools like nativewind for effective styling and development practices.&lt;/p&gt;

</description>
      <category>typescript</category>
      <category>reactnative</category>
      <category>native</category>
      <category>wind</category>
    </item>
  </channel>
</rss>
