<?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: krishnaprasad</title>
    <description>The latest articles on DEV Community by krishnaprasad (@krishna121996).</description>
    <link>https://dev.to/krishna121996</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%2F1088336%2Fa1cd52df-d322-4667-a097-3add50e1ca98.jpeg</url>
      <title>DEV Community: krishnaprasad</title>
      <link>https://dev.to/krishna121996</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/krishna121996"/>
    <language>en</language>
    <item>
      <title>What is flatmap and Advantage of using flatmap ?</title>
      <dc:creator>krishnaprasad</dc:creator>
      <pubDate>Sat, 04 Nov 2023 08:37:31 +0000</pubDate>
      <link>https://dev.to/krishna121996/what-is-flatmap-and-advantage-of-using-flatmap--3h47</link>
      <guid>https://dev.to/krishna121996/what-is-flatmap-and-advantage-of-using-flatmap--3h47</guid>
      <description>&lt;p&gt;&lt;strong&gt;What is Flatmap?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;FlatMap is a higher-order function commonly found in functional programming and many programming languages, including JavaScript, and Java. Its primary purpose is to transform and manipulate collections (such as arrays or lists) in a concise and efficient way.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The flatMap function is used to perform the following operations&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Flattening nested collections:&lt;/strong&gt; When you have a collection of collections (e.g., an array of arrays), you can use flatMap to flatten the nested structure into a single, flat collection. This is particularly useful when working with multidimensional arrays or when you want to remove the nesting of elements.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;const nestedArray = [[1, 2], [3, 4], [5, 6]];&lt;br&gt;
const flatArray = nestedArray.flatMap(arr =&amp;gt; arr);&lt;br&gt;
// flatArray is [1, 2, 3, 4, 5, 6]&lt;br&gt;
&lt;/code&gt;&lt;br&gt;
&lt;strong&gt;Transforming and filtering elements:&lt;/strong&gt; FlatMap allows you to transform each element of a collection while potentially reducing the number of elements. You can also use it to filter elements based on certain criteria.&lt;/p&gt;

&lt;p&gt;In summary, flatMap is a versatile function that can simplify and improve the readability of code when working with collections, especially in cases involving nested structures, mapping, and filtering. It's a powerful tool for functional programming and can lead to more concise and expressive code.&lt;/p&gt;

</description>
      <category>react</category>
      <category>javascript</category>
      <category>flatmap</category>
      <category>programming</category>
    </item>
    <item>
      <title>What is "VirtualizedLists should never be nested inside plain ScrollViews" in React Native?</title>
      <dc:creator>krishnaprasad</dc:creator>
      <pubDate>Sun, 01 Oct 2023 05:48:20 +0000</pubDate>
      <link>https://dev.to/krishna121996/what-is-virtualizedlists-should-never-be-nested-inside-plain-scrollviews-in-react-native-3g66</link>
      <guid>https://dev.to/krishna121996/what-is-virtualizedlists-should-never-be-nested-inside-plain-scrollviews-in-react-native-3g66</guid>
      <description>&lt;p&gt;&lt;strong&gt;What is VirtualizedLists Error?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;In React Native, when you encounter a "VirtualizedLists should never be nested" error while trying to wrap a FlatList inside a ScrollView, it means you are trying to nest multiple virtualized lists within each other, which is not supported by the framework.&lt;/p&gt;

&lt;p&gt;Virtualized lists like FlatList and SectionList are optimized for rendering long lists efficiently by rendering only the visible items on the screen. Nesting them within a ScrollView can lead to conflicts in managing the scroll behavior, as both the ScrollView and the inner FlatList are trying to control the scrolling.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;How to overcome this issue?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Use a Single Virtualized List&lt;/strong&gt;: If your goal is to display a list of items, you can often achieve the desired layout and functionality using a single FlatList or SectionList without the need for a ScrollView. You can style and customize the list to have headers, footers, or other elements as needed.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Use a Header Component&lt;/strong&gt;: If you need to include elements above the FlatList, you can add them as part of the ListHeaderComponent or ListFooterComponent props of the FlatList. This way, you can still achieve the desired layout without nesting virtualized Lists.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;&amp;lt;FlatList&lt;br&gt;
  data={data}&lt;br&gt;
  renderItem={({ item }) =&amp;gt; &amp;lt;ItemComponent item={item} /&amp;gt;}&lt;br&gt;
  ListHeaderComponent={&amp;lt;ComponentAboveFlatlist /&amp;gt;}&lt;br&gt;
  ListFooterComponent={&amp;lt;ComponentBelowFlatlist /&amp;gt;}&lt;br&gt;
/&amp;gt;&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Use SectionList&lt;/strong&gt;: If your data is organized into sections and you need a more complex layout, consider using SectionList, which allows you to create a list with section headers and items within each section.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;&amp;lt;SectionList&lt;br&gt;
  sections={ListData}&lt;br&gt;
  renderItem={({ item }) =&amp;gt; &amp;lt;ItemComponent item={item} /&amp;gt;}&lt;br&gt;
  renderSectionHeader={({ section }) =&amp;gt; &amp;lt;SectionHeaderComponent section={section} /&amp;gt;}&lt;br&gt;
/&amp;gt;&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Avoid nesting virtualized lists like FlatList or SectionList inside a ScrollView unless you have a specific and valid use case for it, as it can lead to performance issues and unpredictable behavior. Instead, try to structure your components and layout in a way that utilizes the capabilities of a single virtualized list or combines them with other components to achieve your desired UI.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What are the consequence on using Flatlist inside scrollview?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Performance Issues&lt;/strong&gt;: Virtualized lists like FlatList are optimized for rendering only the items that are currently visible on the screen. When you nest a virtualized list within a ScrollView, both the ScrollView and the inner FlatList will attempt to manage scrolling independently. This can result in performance degradation as both components compete for control over the scroll behavior.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Unpredictable Scrolling Behavior&lt;/strong&gt;: When you have nested scrolling components, it can lead to unpredictable scrolling behavior. Users may experience difficulties in smoothly scrolling through the content, and it can be challenging to coordinate the scroll positions of the two components effectively.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Difficulty in Handling Events&lt;/strong&gt;: Handling touch events, such as taps and gestures, can become complicated when you have nested scroll views. It can be challenging to determine which component should respond to a particular event, leading to a less intuitive user experience.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Layout Issues&lt;/strong&gt;: It can be challenging to create a consistent and responsive layout when using nested scroll views. The inner FlatList may not behave as expected, and it can be difficult to control the layout of elements within the ScrollView.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Performance Degradation&lt;/strong&gt;: Rendering multiple virtualized lists within a ScrollView can consume more memory and CPU resources than necessary. This can result in slower app performance and increased battery consumption, especially on mobile devices.&lt;/p&gt;

&lt;p&gt;Please do Comment if any queries, Thank you...!&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>react</category>
      <category>reactnative</category>
      <category>vscode</category>
    </item>
    <item>
      <title>Code Obfuscation of Javascript code using JScrambler</title>
      <dc:creator>krishnaprasad</dc:creator>
      <pubDate>Sun, 09 Jul 2023 06:16:50 +0000</pubDate>
      <link>https://dev.to/krishna121996/code-obfuscation-of-javascript-code-using-jscrambler-2nci</link>
      <guid>https://dev.to/krishna121996/code-obfuscation-of-javascript-code-using-jscrambler-2nci</guid>
      <description>&lt;p&gt;&lt;strong&gt;What is code obfuscation?&lt;/strong&gt;&lt;br&gt;
Code obfuscation is the process of modifying the source code of a program to make it difficult to understand and analyze, while preserving its functionality. In the case of JavaScript, obfuscation is often used to protect sensitive information or intellectual property, as well as to make it harder for attackers to reverse engineer or exploit the code.&lt;/p&gt;

&lt;p&gt;There are different techniques used for code obfuscation and few were stated below,&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Variable and Function Renaming&lt;/strong&gt;&lt;br&gt;
One of the simplest techniques is to rename variables and functions to meaningless or randomly generated names. This makes the code harder to understand and follow.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;String Encryption&lt;/strong&gt;&lt;br&gt;
Encrypting strings within the code and dynamically decrypting them at runtime can make it difficult for an attacker to extract sensitive information from the code.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Code Splitting&lt;/strong&gt;&lt;br&gt;
Breaking up the code into multiple parts and dynamically loading them at runtime can make it harder for someone to understand the overall flow of the program.&lt;/p&gt;

&lt;p&gt;*&lt;em&gt;Code Transformation *&lt;/em&gt;&lt;br&gt;
Transforming the code structure, such as changing the order of statements, adding redundant code, or using complex control flow constructs, can make the code more convoluted and challenging to comprehend.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Removing Whitespace and Comments&lt;/strong&gt;&lt;br&gt;
Stripping out unnecessary whitespace and comments can make the code more compact and harder to read, although this is more of a basic obfuscation technique.&lt;/p&gt;

&lt;p&gt;It's important to note that code obfuscation is not a foolproof security measure. A determined attacker can still reverse engineer or analyze the obfuscated code given enough time and effort. However, obfuscation can act as a deterrent and make it more time-consuming for an attacker to understand the code.&lt;/p&gt;

&lt;p&gt;There are several JavaScript obfuscation tools available that automate these techniques. Some popular ones &lt;strong&gt;JS Defender&lt;/strong&gt;, &lt;strong&gt;JScrambler&lt;/strong&gt; and &lt;strong&gt;Appdome&lt;/strong&gt;. These tools can help streamline the obfuscation process and generate obfuscated versions of your JavaScript code.&lt;/p&gt;

&lt;p&gt;Here I have used Jscrambler for the understanding of engineering and limitation of obfuscating the code.&lt;/p&gt;

&lt;p&gt;Sign in and create the dashboard on the jscrambler by connecting your Demo app. I have used this link to create the sample project and connect the code with Jscrambler dashboard.&lt;/p&gt;

&lt;p&gt;Make sure you have configure the token generated from the dashboard should be linked with the app config file to have proper connection with the dashboard.&lt;/p&gt;

&lt;p&gt;To confirm the connection, execute the following command and see the console.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;Jscrambler&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Once all the connection is completed, we were able to see the app name in the dashboard with the code from js file.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--c6dOBRW2--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/sdeqwzsrde126wpf2ywb.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--c6dOBRW2--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/sdeqwzsrde126wpf2ywb.png" alt="Image description" width="558" height="78"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now we have to choose the options from the dashboard for obfuscation, As am using the trial version of jscrambler, we can obfuscate only the variable name.&lt;/p&gt;

&lt;p&gt;In the below screenshot you can see the obfuscation of variable name.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--TBjUmDor--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/cty4nzdlrtu8q12cmmyf.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--TBjUmDor--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/cty4nzdlrtu8q12cmmyf.png" alt="Image description" width="800" height="274"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Note: We have tried using the code obfuscation tool for react native and react js. But there is some limitation in obfuscating the JSX code. &lt;/p&gt;

&lt;p&gt;Thanks for Reading,&lt;/p&gt;

&lt;p&gt;Happy coding.....!&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>react</category>
      <category>code</category>
      <category>obfuscation</category>
    </item>
    <item>
      <title>Native Base with React native</title>
      <dc:creator>krishnaprasad</dc:creator>
      <pubDate>Sat, 01 Jul 2023 15:14:20 +0000</pubDate>
      <link>https://dev.to/krishna121996/native-base-with-react-native-b3</link>
      <guid>https://dev.to/krishna121996/native-base-with-react-native-b3</guid>
      <description>&lt;p&gt;&lt;strong&gt;What is Native Base?&lt;/strong&gt;&lt;br&gt;
NativeBase is a popular open-source UI component library for building cross-platform mobile applications using React Native. It provides a set of pre-designed and customizable UI components that follow the principles of Material Design, making it easier and faster to develop mobile apps with a consistent look and feel.&lt;/p&gt;

&lt;p&gt;NativeBase offers a wide range of reusable components such as buttons, forms, headers, footers, cards, tabs, and much more. These components are built using React Native, a JavaScript framework for building native mobile applications, and they are compatible with both iOS and Android platforms.&lt;/p&gt;

&lt;p&gt;The library also includes a theme-based styling system, allowing developers to easily customize the appearance of their app by modifying the theme variables. This makes it simple to create visually appealing and consistent designs across different screens and devices.&lt;/p&gt;

&lt;p&gt;NativeBase has gained popularity in the React Native community due to its ease of use, extensive component library, and active development community. It simplifies the development process by providing ready-to-use components and helps developers create high-quality mobile applications more efficiently.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;How to use Native Base?&lt;/strong&gt;&lt;br&gt;
 To start with native base install the required dependencies.&lt;br&gt;
&lt;code&gt;npm install native-base&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;After installing the dependency, import the native-base in required component.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;import { Button } from 'native-base';&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Here we'll go through the implementation simple button using native base.&lt;br&gt;
&lt;code&gt;render() {&lt;br&gt;
  return (&lt;br&gt;
    &amp;lt;Button&amp;gt;&lt;br&gt;
      &amp;lt;Text&amp;gt;Click me&amp;lt;/Text&amp;gt;&lt;br&gt;
    &amp;lt;/Button&amp;gt;&lt;br&gt;
  );&lt;br&gt;
}&lt;br&gt;
&lt;/code&gt;&lt;br&gt;
&lt;strong&gt;Theming Using native Base&lt;/strong&gt;&lt;br&gt;
Using NativeBase with theming offers several advantages for developing React Native applications:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Consistent Design&lt;/strong&gt;: NativeBase provides a set of pre-designed UI components that follow the principles of Material Design. By using NativeBase, you can ensure a consistent look and feel across your app, leading to a professional and polished user interface.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Rapid Development&lt;/strong&gt;: NativeBase simplifies the development process by providing ready-to-use components. With a wide range of customizable UI elements, you can quickly build screens and user interactions without spending much time on design and styling.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Customizability&lt;/strong&gt;: NativeBase offers a theme-based styling system that allows you to customize the appearance of components to match your app's branding or design requirements. By defining a custom theme and applying it, you can easily modify colors, typography, spacing, and other visual aspects of your app.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Reusability&lt;/strong&gt;: With NativeBase, you can create reusable components that encapsulate certain UI patterns or functionality. These components can be easily reused across different screens and even shared between projects, leading to more efficient and maintainable code.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Cross-Platform Compatibility&lt;/strong&gt;: NativeBase is compatible with both iOS and Android platforms. By using NativeBase components, you can develop mobile applications that work seamlessly on multiple platforms, saving you from the effort of writing platform-specific code.&lt;/p&gt;

&lt;p&gt;Active Community and Support: NativeBase has a large and active community of developers. This means you can benefit from the collective knowledge and expertise of the community members. You can find tutorials, examples, and solutions to common problems, making it easier to troubleshoot issues and learn from others.&lt;/p&gt;

&lt;p&gt;Overall, using NativeBase with theming simplifies the development process, improves the user experience, and provides a consistent and visually appealing interface for your React Native applications.&lt;/p&gt;

&lt;p&gt;Thanks for Reading....!&lt;br&gt;
Happy coding.....!&lt;/p&gt;

</description>
      <category>xcode</category>
      <category>react</category>
      <category>nativebase</category>
      <category>reactnative</category>
    </item>
    <item>
      <title>How to resolve "deriveddata/consumerapp_v1/build/products/debug-iphonesimulator not found" issue</title>
      <dc:creator>krishnaprasad</dc:creator>
      <pubDate>Mon, 12 Jun 2023 12:00:25 +0000</pubDate>
      <link>https://dev.to/krishna121996/how-to-resolve-deriveddataconsumerappv1buildproductsdebug-iphonesimulator-not-found-issue-4p7</link>
      <guid>https://dev.to/krishna121996/how-to-resolve-deriveddataconsumerappv1buildproductsdebug-iphonesimulator-not-found-issue-4p7</guid>
      <description>&lt;p&gt;While running the app in simulator in m1 system, these type of issues will be identified. To Resolve this kind of issue, we have ensure few steps in the xcode setup.&lt;/p&gt;

&lt;p&gt;Navigate to target/Buildsettings from the xcode and search for &lt;strong&gt;Excluded Architecture&lt;/strong&gt;. And add the configuration as below.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--14_GdA0v--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/6qowbvp9zkkcf0cwrfvv.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--14_GdA0v--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/6qowbvp9zkkcf0cwrfvv.png" alt="Image description" width="800" height="479"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Based on the need, we can add this for debug/release builds and save the required values.&lt;/p&gt;

&lt;p&gt;Now delete the derived data and clean the project by build =&amp;gt; clean. Now try running the project in the simulator.&lt;/p&gt;

&lt;p&gt;Thanks for Reading.&lt;br&gt;
Happy Coding&lt;/p&gt;

</description>
      <category>xcode</category>
      <category>react</category>
      <category>architecture</category>
    </item>
    <item>
      <title>How to fix "Cannot find module 'node-darwin-arm64/package.json"</title>
      <dc:creator>krishnaprasad</dc:creator>
      <pubDate>Sun, 11 Jun 2023 13:58:27 +0000</pubDate>
      <link>https://dev.to/krishna121996/how-to-fix-cannot-find-module-node-darwin-arm64packagejson-10i2</link>
      <guid>https://dev.to/krishna121996/how-to-fix-cannot-find-module-node-darwin-arm64packagejson-10i2</guid>
      <description>&lt;p&gt;These issues were commonly occurring in M1 chip users. This can be noticed after taking the clone of the project and while doing npm install.&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

Cannot find module 'node-darwin-arm64/package.json'


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;This is due to an architecture mismatch happening while installing dependencies in the system. Darwin is one of the main dependencies which will create the node folder, which is key for other dependencies to install.&lt;/p&gt;

&lt;p&gt;To resolve the issue, install NVM (Node Version Manager) to continue installing the Node dependencies with the arch flag.&lt;br&gt;
Please nvm installation guide for easy implementation.&lt;/p&gt;

&lt;p&gt;Run &lt;strong&gt;nvm ls&lt;/strong&gt; command to verify the dependencies installed properly. And it looks as below,&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fttpliicfxzt38zsadcaf.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fttpliicfxzt38zsadcaf.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now check the arch flag in the terminal using command &lt;strong&gt;arch&lt;/strong&gt; in terminal. By default it will be arm64.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fin12ahdog1t3ztq70p9s.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fin12ahdog1t3ztq70p9s.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;For M1 user, npm needs to install with i386 arch flags to avoid the darwin dependency issue error. Do uninstall the existing node version using the below command.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;nvm uninstall 14.21.3 //uninstall the respective node versions&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;To install the node with arch flag, enter the below command to execute &lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

arch -x86_64 zsh 


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fw2ojmynxclqbjpm2jhxx.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fw2ojmynxclqbjpm2jhxx.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now the arch reference is pointed to i386, and make sure not to kill the terminal because this flag will remain until we terminate the terminal. To install Node with NVM, use the following command.&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

nvm install 14.21.3
nvm alias default 14.21.3



&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;After all these executions, try running npm install, and now you could see in the terminal that the darwin dependency is created successfully.&lt;/p&gt;

&lt;p&gt;Thanks for Reading, Do comment if any queries.&lt;br&gt;
Happy Coding...&lt;/p&gt;

</description>
      <category>reactnative</category>
      <category>objectivec</category>
      <category>m1</category>
      <category>xcode</category>
    </item>
    <item>
      <title>How to Communicate with the native component from React native using bridge</title>
      <dc:creator>krishnaprasad</dc:creator>
      <pubDate>Wed, 24 May 2023 04:14:01 +0000</pubDate>
      <link>https://dev.to/krishna121996/how-to-communicate-with-the-native-component-from-react-native-using-bridge-2kpj</link>
      <guid>https://dev.to/krishna121996/how-to-communicate-with-the-native-component-from-react-native-using-bridge-2kpj</guid>
      <description>&lt;p&gt;To communicate with native components using a bridge, you'll typically need to follow a few steps. Here's a general overview of the process&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Set up the bridge&lt;/strong&gt;: Depending on the platform you're working with (e.g., Android, iOS, React Native), you'll need to set up a bridge that enables communication between the native code and your JavaScript code.&lt;/p&gt;

&lt;p&gt;Define the communication protocol: Determine how you want to exchange data and messages between the native components and your JavaScript code. This could involve defining methods, events, or callbacks that can be accessed through the bridge.&lt;/p&gt;

&lt;p&gt;implement the native component: Write the native code component using the appropriate programming language (e.g., Java or Kotlin for Android, Objective-C or Swift for iOS). This component should expose the methods or events you want to communicate with from JavaScript.&lt;/p&gt;

&lt;p&gt;Expose the native component to JavaScript: Use the bridge to expose the native component to your JavaScript code. This typically involves registering the component with the bridge and providing a unique identifier.&lt;/p&gt;

&lt;p&gt;Access the native component from JavaScript: Once the native component is exposed, you can access its methods or listen to its events from your JavaScript code. This is typically done using the bridge's API, which allows you to call native methods or subscribe to events.&lt;/p&gt;

&lt;p&gt;Handle communication: Use the bridge to send messages or data between the native component and your JavaScript code. This could involve invoking native methods, passing parameters, receiving and processing callbacks, or emitting events.&lt;/p&gt;

&lt;p&gt;It's important to note that the exact implementation details may vary depending on the platform and bridge you're using. For example, React Native provides its own bridge called "React Native Bridge," while frameworks like Flutter or Xamarin have their own mechanisms for native code integration.&lt;/p&gt;

&lt;p&gt;Attaching the few doc's which visualize how the bridge is created.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--NsjcK98x--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/1rh4dbkwmo5esuhtwoxr.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--NsjcK98x--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/1rh4dbkwmo5esuhtwoxr.png" alt="Image description" width="572" height="228"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The above image shows both the meta and header files created successfully, Now you can connect the those bridge using native modules from the React.&lt;/p&gt;

&lt;p&gt;Thanks for Reading....&lt;/p&gt;

</description>
      <category>reactnative</category>
      <category>android</category>
      <category>ios</category>
    </item>
  </channel>
</rss>
