<?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 Ateshan Gunduz on Medium]]></title>
        <description><![CDATA[Stories by Ateshan Gunduz on Medium]]></description>
        <link>https://medium.com/@atshn.gunduz?source=rss-107b6d28815b------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*0NqP4CosEIGwWFC9W-w3AQ.jpeg</url>
            <title>Stories by Ateshan Gunduz on Medium</title>
            <link>https://medium.com/@atshn.gunduz?source=rss-107b6d28815b------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 14 Nov 2026 21:19:33 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@atshn.gunduz/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[Devin AI Software Engineer]]></title>
            <link>https://blog.stackademic.com/devin-ai-software-engineer-47d0f9b6932c?source=rss-107b6d28815b------2</link>
            <guid isPermaLink="false">https://medium.com/p/47d0f9b6932c</guid>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[developer]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[devin-ai]]></category>
            <category><![CDATA[software-engineering]]></category>
            <dc:creator><![CDATA[Ateshan Gunduz]]></dc:creator>
            <pubDate>Sun, 24 Mar 2024 10:19:20 GMT</pubDate>
            <atom:updated>2024-03-28T00:19:50.209Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/957/1*VbeDuRBwvNnA5bTvUnW30A.png" /></figure><p>Devin is claimed to be the world’s first fully autonomous AI software engineer. There are several features claimed that Devin can achieve but how accurate and true those claims are. Do developers need be scared? Will AI eventually take our jobs? Many questions to be answered, but we should not be so worried about it. We should consider the fact that claims might be tested on specific, trained areas and there might be loop holes where developers can thrive. We should also consider that Cognition-Labs need a lot of funding and they need to come up with best results.</p><p><a href="https://www.cognition-labs.com/introducing-devin">Introducing Devin, the first AI software engineer</a></p><p>Devin’s capabilities are consist of “Learning unfamiliar technologies”, “End to end build and deployment”, “Finding and fixing bug autonomously”, “Training and tuning its own AI”, “Addressing bugs and feature request from repos”, “Contribute to production repos”, and “Accomplishing real jobs from Upwork”.</p><p>If we deep dive into capabilities claimed, and be little suspicions about the data given from the link above we can find out that implementation and reality is not that scary. For instance, “Devin correctly resolves 13.86%* of the issues end-to-end, far exceeding the previous state-of-the-art of 1.96%.” However chart description gives us an information such “*Devin was evaluated on a random 25% subset of the dataset.” Although, what Devin can accomplish seems impressing, since we can not try ourself, some of the information are still vague. This means, they may randomly choose the 25% until they got 25% that provide the intended number.</p><p>Overall, Devin is a cool tool can accomplish many things. Still, it currently needs a technical knowledge in order to use it. It shall make developers jobs easy and fast.</p><h3>Stackademic 🎓</h3><p>Thank you for reading until the end. Before you go:</p><ul><li>Please consider <strong>clapping</strong> and <strong>following</strong> the writer! 👏</li><li>Follow us <a href="https://twitter.com/stackademichq"><strong>X</strong></a><strong> | </strong><a href="https://www.linkedin.com/company/stackademic"><strong>LinkedIn</strong></a><strong> | </strong><a href="https://www.youtube.com/c/stackademic"><strong>YouTube</strong></a><strong> | </strong><a href="https://discord.gg/in-plain-english-709094664682340443"><strong>Discord</strong></a></li><li>Visit our other platforms: <a href="https://plainenglish.io/"><strong>In Plain English</strong></a><strong> | </strong><a href="https://cofeed.app/"><strong>CoFeed</strong></a><strong> | </strong><a href="https://venturemagazine.net/"><strong>Venture</strong></a><strong> | </strong><a href="https://blog.cubed.run/"><strong>Cubed</strong></a></li><li>More content at <a href="https://stackademic.com/"><strong>Stackademic.com</strong></a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=47d0f9b6932c" width="1" height="1" alt=""><hr><p><a href="https://blog.stackademic.com/devin-ai-software-engineer-47d0f9b6932c">Devin AI Software Engineer</a> was originally published in <a href="https://blog.stackademic.com/">Stackademic</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[An Introduction to React Native]]></title>
            <link>https://blog.stackademic.com/react-native-ddfffd39bebf?source=rss-107b6d28815b------2</link>
            <guid isPermaLink="false">https://medium.com/p/ddfffd39bebf</guid>
            <category><![CDATA[front-end-development]]></category>
            <category><![CDATA[mobile-app-development]]></category>
            <category><![CDATA[reactjs]]></category>
            <category><![CDATA[react-native]]></category>
            <category><![CDATA[react]]></category>
            <dc:creator><![CDATA[Ateshan Gunduz]]></dc:creator>
            <pubDate>Tue, 12 Mar 2024 12:40:12 GMT</pubDate>
            <atom:updated>2024-03-14T01:15:49.101Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/818/1*vU0S7PacvtK7pog0TaDEwQ.png" /></figure><p>For building cross-platform mobile applications with JavaScript and React, React Native is a useful option. Before the cross-platform frameworks such as React Native, specific tools and languages were needed for iOS and Android seperatly. Specifically, Objective-C, Swift and Xcode for iOS and Kotlin, Java and Android studio for Android. Those were causing several challenges such as time, learning curve and code duplication. Developing separate codebases for both were time and resource consuming and often led to code duplication. On the other hand developers were need to be proficient in languages of both sides. React Native enables developers to create apps with single codebase for both iOS and Android.</p><p>In order to demonstrate simple introduction to React Native, predefined components called tags and CSS with objects will be our beginning point.</p><h4>React Native Tags</h4><p>Just like the tags in React, we are using special tags in our JSX.</p><pre>import { StyleSheet,Alert, Text, View, Modal, ImageBackground, ScrollView, Button, ActivityIndicator } from &#39;react-native&#39;</pre><p>When compared to react, View works similar with div and Text works similar with p or span tags. ScrollView on the other hand provides us a scrollable div. ImageBackground let us set a box with background using uri instead of url.</p><pre>&lt;View&gt;<br>&lt;ScrollView&gt;<br>     &lt;Button title=&#39;Press&#39; onPress={handleClick}/&gt;<br>     &lt;ImageBackground source={{ uri: &quot;https://images.unsplash.com/photo-1709525091854-7152bddb6d9d?q=80&amp;w=2000&amp;auto=format&amp;fit=crop&amp;ixlib=rb-4.0.3&amp;ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D&quot;}} style={{flex : 1, width: 350, }}&gt;<br>       &lt;Text  style={{padding: 30}}&gt;Lorem ipsum dolor sit amet consectetur adipisicing elit. Nulla, velit. Explicabo facilis id nostrum autem! Doloribus nobis laboriosam illum velit sed, magnam eius unde, cilis id.&lt;/Text&gt;<br>     &lt;/ImageBackground&gt;<br>&lt;/ScrollView&gt;   <br>&lt;/View&gt;</pre><p>Modal let us to prevent navigate full page transition by overlaying a component on our page. This helps user helps to keep the user’s focus on a specific task. Also instead of onClick we are using onPress to handle our button functions.</p><pre>   &lt;Modal visible={first} animationType=&quot;slide&quot; &gt;<br>     &lt;View style={styles.container}&gt;<br>      &lt;Button title=&#39;Press&#39; onPress={handleClick} /&gt;<br>      &lt;Text&gt;sdfsdfaasdasdasdasdsdfsdfsdfsdfsd&lt;/Text&gt;<br>      &lt;ImageBackground source={{uri : &quot;https://plus.unsplash.com/premium_photo-1705091982376-d1a42ed0869c?w=400&amp;auto=format&amp;fit=crop&amp;q=60&amp;ixlib=rb-4.0.3&amp;ixid=M3wxMjA3fDB8MHxlZGl0b3JpYWwtZmVlZHw1Mnx8fGVufDB8fHx8fA%3D%3D&quot;}} style={{ flex: 1, width: 350, height: 200,  }}&gt;<br>         &lt;/ImageBackground&gt;<br>    &lt;/View&gt;<br>   &lt;/Modal&gt;</pre><h4>Styling</h4><p>In React Native, styles are defined using JavaScript objects and can be applied directly to components. Or we can also use inline styles.</p><pre>const styles = StyleSheet.create({<br>  container: {<br>    flex: 1,<br>    backgroundColor: &#39;#fff&#39;,<br>    alignItems: &#39;center&#39;,<br>    justifyContent: &#39;center&#39;,<br>    paddingTop: 100,j    <br>  },<br>})<br><br>export default function App() { <br>return (<br>    &lt;View style={styles.container}&gt;<br>      &lt;ScrollView&gt;<br>      &lt;Button title=&#39;Press&#39; onPress={handleClick}/&gt;<br>      &lt;ImageBackground source={{ uri: &quot;&quot;}} style={{flex : 1, width: 350, }}&gt;<br>       &lt;/ImageBackground&gt;<br>    &lt;/View&gt;<br>)}</pre><p>Although there many other abilities you can do with React Native as starting up a basic demonstration shall suffice. React native is becoming more popular due to its efficiency in the development process.</p><h3>Stackademic 🎓</h3><p>Thank you for reading until the end. Before you go:</p><ul><li>Please consider <strong>clapping</strong> and <strong>following</strong> the writer! 👏</li><li>Follow us <a href="https://twitter.com/stackademichq"><strong>X</strong></a><strong> | </strong><a href="https://www.linkedin.com/company/stackademic"><strong>LinkedIn</strong></a><strong> | </strong><a href="https://www.youtube.com/c/stackademic"><strong>YouTube</strong></a><strong> | </strong><a href="https://discord.gg/in-plain-english-709094664682340443"><strong>Discord</strong></a></li><li>Visit our other platforms: <a href="https://plainenglish.io/"><strong>In Plain English</strong></a><strong> | </strong><a href="https://cofeed.app/"><strong>CoFeed</strong></a><strong> | </strong><a href="https://venturemagazine.net/"><strong>Venture</strong></a><strong> | </strong><a href="https://blog.cubed.run/"><strong>Cubed</strong></a></li><li>More content at <a href="https://stackademic.com/"><strong>Stackademic.com</strong></a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ddfffd39bebf" width="1" height="1" alt=""><hr><p><a href="https://blog.stackademic.com/react-native-ddfffd39bebf">An Introduction to React Native</a> was originally published in <a href="https://blog.stackademic.com/">Stackademic</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[React19 2024 What’s coming?]]></title>
            <link>https://towardsdev.com/react19-2024-whats-coming-22065682e9df?source=rss-107b6d28815b------2</link>
            <guid isPermaLink="false">https://medium.com/p/22065682e9df</guid>
            <category><![CDATA[react-hook]]></category>
            <category><![CDATA[react]]></category>
            <category><![CDATA[reactjs]]></category>
            <category><![CDATA[react-19]]></category>
            <category><![CDATA[frontend-development]]></category>
            <dc:creator><![CDATA[Ateshan Gunduz]]></dc:creator>
            <pubDate>Sun, 03 Mar 2024 08:03:09 GMT</pubDate>
            <atom:updated>2024-03-04T17:14:09.176Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/826/1*Hz76KEW4oCGjxxistKTgOg.png" /></figure><p>The new major release, React 19, is estimated to be out at the end of 2024 or at the beginning of 2025. Possible features that might be implemented in future and the general direction that react is going is released by React recently. For the full detailed information you can reach the formal article below.</p><p><a href="https://react.dev/blog/2024/02/15/react-labs-what-we-have-been-working-on-february-2024">React Labs: What We&#39;ve Been Working On - February 2024 - React</a></p><p>In order to quick sum up the situation and understand what is coming, lets dive-in on what is coming.</p><h4>React Compiler</h4><p>It used to be a research project within the react team. However, recent release tells us that it is currently powers the Instagram. So it is working. But what does is do? It is basically a solution for unnecessary renders in our components. We all stumble upon situations where only certain parts of our component should be re-rendered. Still, in those situation we are provided useMemo, useCallback, and memo. React Compiler brings us an automatic solution in which we will no longer need to use those performance optimization tools. It will re-render only right parts of the component by itself so that developers will not need to deal with memoization.</p><h4>Actions</h4><p>It is collection of actions for data submission from client to server. Basically enables synchronous and asynchronous functions for submitting by two new hooks called useFormStatus and useFormState. First one is for giving us a status information about the last submission of the form. Second one on the other hand is updates the state with the result of form action.</p><pre>import { useFormStatus } from &quot;react-dom&quot;;<br>import action from &#39;./actions&#39;;<br><br>function Submit() {<br>  const status = useFormStatus();<br>  return &lt;button disabled={status.pending}&gt;Submit&lt;/button&gt;<br>}<br><br>export default function App() {<br>  return (<br>    &lt;form action={action}&gt;<br>      &lt;Submit /&gt;<br>    &lt;/form&gt;<br>  );<br>}</pre><pre>import { useFormState } from &quot;react-dom&quot;;<br><br>async function increment(previousState, formData) {<br>  return previousState + 1;<br>}<br><br>function StatefulForm({}) {<br>  const [state, formAction] = useFormState(increment, 0);<br>  return (<br>    &lt;form&gt;<br>      {state}<br>      &lt;button formAction={formAction}&gt;Increment&lt;/button&gt;<br>    &lt;/form&gt;<br>  )<br>}</pre><h4>useOptimistic</h4><p>Brand new hook along side with actions. It enables us to optimistically update the UI. In which temporary updates will be automatically reverted once the final state commits.</p><pre>import { useOptimistic } from &#39;react&#39;;<br><br>function AppContainer() {<br>  const [optimisticState, addOptimistic] = useOptimistic(<br>    state,<br>    // updateFn<br>    (currentState, optimisticValue) =&gt; {<br>      // merge and return new state<br>      // with optimistic value<br>    }<br>  );<br>}</pre><p>You can check and test those new features before the actual release from the new Canary channel on React’s website below.</p><p><a href="https://react.dev/community/versioning-policy#canary-channel">Versioning Policy - React</a></p><h3>Canary Channel</h3><p>With this feature React allow us test everything before. They are releasing the canary with many features such as react server components, asset loading, document metadata and the actions.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=22065682e9df" width="1" height="1" alt=""><hr><p><a href="https://towardsdev.com/react19-2024-whats-coming-22065682e9df">React19 2024 What’s coming?</a> was originally published in <a href="https://towardsdev.com/">Towards Dev</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to Set Up and Implement createBrowserRouter in Your App]]></title>
            <link>https://blog.stackademic.com/createbrowserrouter-57a8955c4076?source=rss-107b6d28815b------2</link>
            <guid isPermaLink="false">https://medium.com/p/57a8955c4076</guid>
            <category><![CDATA[reactjs]]></category>
            <category><![CDATA[react-hook]]></category>
            <category><![CDATA[react-router]]></category>
            <category><![CDATA[react-router-dom]]></category>
            <category><![CDATA[react]]></category>
            <dc:creator><![CDATA[Ateshan Gunduz]]></dc:creator>
            <pubDate>Thu, 22 Feb 2024 13:06:55 GMT</pubDate>
            <atom:updated>2024-02-26T01:17:24.970Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/678/1*WF0T-ixyNgP0sDY1711PWw.png" /></figure><p>React-router-dom contains multiple ways to set-up our routing. However, createBrowserRouter is the recommended way by the react-router. It will allow us to navigate between our pages in a compact, well-organized way. We can even have dynamic routers connected to fetched API using react-query. Our small basic demonstration will show us how to set it up and implement it in our app.</p><p><a href="https://crypto-v1-react-query.vercel.app/">Vite + React + TS</a></p><p>Note: You can check out my recent unfinished website from the link above. It is made with createBrowserRouter. So that you can also see what I mean.</p><pre>import { createBrowserRouter, RouterProvider } from &#39;react-router-dom&#39;;<br><br>import App from &#39;./App.tsx&#39;<br><br>const router = createBrowserRouter([{<br>  path: &quot;/&quot;,<br>  element: &lt;App/&gt;,<br>  errorElement: &lt;NotFoundPage/&gt;,<br>  children: [{<br>    path: &quot;/prices/:crypto&quot;,<br>    element: &lt;Prices/&gt;<br>  }]<br>  },<br>  {<br>    path: &quot;/login&quot;,<br>    element: &lt;LoginForm/&gt;<br>  },<br>  {<br>    path: &quot;/signin&quot;,<br>    element: &lt;SignInForm/&gt;<br>  },<br>  {<br>    path: &quot;/trade&quot;,<br>    element: &lt;Trade/&gt;<br>  },<br>])<br><br>ReactDOM.createRoot(document.getElementById(&#39;root&#39;)!).render(<br>  &lt;React.StrictMode&gt;<br>      &lt;RouterProvider router={router}/&gt;<br>  &lt;/React.StrictMode&gt;,<br>)</pre><p>createBroweserRouter gets an array with objects. Those objects are containing our route logic with some keys such as path, element, children.<br>Basically, path that we give is belong to the element which is a component in our app. That path shall render the related component. errorElement helps us to manage errors with its own component. The component in the errorElement can contain its own Link that helps us to go back to home page. We can also use children key for creating another routing logic in certain path we choose. path: “/prices/<em>:crypto</em>” allow us to dynamically give a selected path. With using react-query, axios and useState we can connect them to this :crypto so that When user select from a display its dynamically fetches the chosen one with its id and give it into :crypto. path: “/prices/<em>SELECTED ITEM</em>”</p><pre>import { Link } from &quot;react-router-dom&quot;<br>  <br> &lt;div&gt;<br>       &lt;Link to={&quot;/trade&quot;}&gt;Spot 🚀&lt;/Link&gt;<br>       &lt;Link to={&quot;/trade&quot;}&gt;Margin&lt;/Link&gt;<br>        &lt;Link to={&quot;/trade&quot;}&gt;APIs&lt;/Link&gt;<br>    &lt;/div&gt;</pre><p>After setting up our logic we can use Link from react-router-dom into our JSX to navigate to that component from any component.</p><pre>import { useNavigate } from &quot;react-router-dom&quot;<br><br>const navigate = useNavigate();<br><br>const onSubmit: SubmitHandler&lt;FormFields&gt; = async (data)=&gt;{<br>    try{<br>        await new Promise((resovle)=&gt; setTimeout(resovle, 1000))<br><br>        dispatch(setFormData(data))<br>        navigate(&quot;/charts&quot;)<br>    } catch (error) {<br>         setError(&quot;root&quot;, {message: &quot;This email is already taken&quot;})<br>    }<br>  <br>}</pre><p>The example above is an extra. Just to show one other ability we can use. useNavigate from react-router-dom let us to navigate into certain path within a function that we use. In the example above function submits the form. It does many things and in end it navigates to the path we give.</p><h3>Stackademic 🎓</h3><p>Thank you for reading until the end. Before you go:</p><ul><li>Please consider <strong>clapping</strong> and <strong>following</strong> the writer! 👏</li><li>Follow us <a href="https://twitter.com/stackademichq"><strong>X</strong></a><strong> | </strong><a href="https://www.linkedin.com/company/stackademic"><strong>LinkedIn</strong></a><strong> | </strong><a href="https://www.youtube.com/c/stackademic"><strong>YouTube</strong></a><strong> | </strong><a href="https://discord.gg/in-plain-english-709094664682340443"><strong>Discord</strong></a></li><li>Visit our other platforms: <a href="https://plainenglish.io/"><strong>In Plain English</strong></a><strong> | </strong><a href="https://cofeed.app/"><strong>CoFeed</strong></a><strong> | </strong><a href="https://venturemagazine.net/"><strong>Venture</strong></a><strong> | </strong><a href="https://blog.cubed.run/"><strong>Cubed</strong></a></li><li>More content at <a href="https://stackademic.com/"><strong>Stackademic.com</strong></a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=57a8955c4076" width="1" height="1" alt=""><hr><p><a href="https://blog.stackademic.com/createbrowserrouter-57a8955c4076">How to Set Up and Implement createBrowserRouter in Your App</a> was originally published in <a href="https://blog.stackademic.com/">Stackademic</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[redux-toolkit]]></title>
            <link>https://medium.com/@atshn.gunduz/redux-toolkit-c1cddfba5712?source=rss-107b6d28815b------2</link>
            <guid isPermaLink="false">https://medium.com/p/c1cddfba5712</guid>
            <category><![CDATA[redux]]></category>
            <category><![CDATA[frontend-development]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[redux-toolkit]]></category>
            <category><![CDATA[typescript]]></category>
            <dc:creator><![CDATA[Ateshan Gunduz]]></dc:creator>
            <pubDate>Fri, 16 Feb 2024 10:26:48 GMT</pubDate>
            <atom:updated>2024-02-16T10:26:48.085Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/775/1*hZTYsoQ_AHZXocPhngY0HQ.png" /></figure><p>Redux helps manage the state of an application, making it easier to reason about state changes and manage complex state logic. Redux Toolkit, provides utilities to simplify redux based applications. It reduces the boilerplate code of redux and makes state management a lot easier.</p><pre>npm install @reduxjs/toolkit react-redux</pre><p>We can start installing ReduxToolkit for our basic demonstration.</p><pre>import { configureStore } from &quot;@reduxjs/toolkit&quot;;<br>import { formReducer } from &quot;../features/profileSlice&quot;;<br><br><br>export const store = configureStore({<br>    reducer: {<br>      ....  // here comes the slice<br>    },<br>  });</pre><p>With configureStore we can store our reducers that contains specific Slice that manages our states and functions related to them.</p><pre>import { Provider } from &#39;react-redux&#39;<br>import { store } from &#39;./store/store.ts&#39;<br><br>ReactDOM.createRoot(document.getElementById(&#39;root&#39;)!).render(<br>  &lt;React.StrictMode&gt;<br>     &lt;Provider store={store}&gt;<br>     &lt;App/&gt;<br>    &lt;/Provider&gt;<br>    &lt;/QueryClientProvider&gt;<br>  &lt;/React.StrictMode&gt;,<br>)</pre><p>Then we wrap our app with the Provider and store we created to let our app to reach those states and its managing functions.</p><pre>import { createSlice } from &quot;@reduxjs/toolkit&quot;<br><br><br>const initialState = {<br>    formData: {<br>      email: &quot;&quot;,<br>      password: &quot;&quot;,<br>    },<br>  };<br><br>  const formSlice = createSlice({<br>    name: &quot;form&quot;,<br>    initialState,<br>    reducers: {<br>      setFormData: (state, action) =&gt; {<br>        state.formData = action.payload;<br>      },<br>      clearFormData: (state) =&gt; {<br>        state.formData = initialState.formData;<br>      },<br>    },<br>  });<br><br>  export const { setFormData, clearFormData, setProfile } = formSlice.actions;<br>  export const formReducer = formSlice.reducer;</pre><p>After that we create our Slice. We create an initialState with an object. createSlice from redux helps use to conduct our slice. The object contains name, initialState that we created. (just like useState(“”)). reducer key is an object and with the help state and action it will let us to change formData. We need to export our reducers and formSlice.</p><pre>import { configureStore } from &quot;@reduxjs/toolkit&quot;;<br>import { formReducer } from &quot;../features/profileSlice&quot;;<br><br>export const store = configureStore({<br>    reducer: {<br>      formSlice: formReducer,<br>    },<br>  });</pre><p>We use exported forReducer in here. It is one of our slices. And the exported actions will be used in components.</p><pre>import { useDispatch } from &quot;react-redux&quot;;<br>import { setFormData } from &quot;../features/profileSlice&quot;;<br><br>const SignInForm = () =&gt; {<br>const dispatch = useDispatch();<br><br>const onSubmit: SubmitHandler&lt;FormFields&gt; = async (data)=&gt;{<br>    try{<br>        await new Promise((resovle)=&gt; setTimeout(resovle, 1000))<br>        dispatch(setFormData(data))<br>    } catch (error) {<br>         setError(&quot;root&quot;, {message: &quot;This email is already taken&quot;})<br>    }<br>  <br>}<br><br>return(<br>...<br>)<br>}</pre><p>In here with the help of useDispatch() we can dispatch our imported action and use. We gets data from a form and dispatch the setFormData action with our submitted data so that formData’s states can change accordingly.</p><p>By doing so we did not used useStates in components. We handled states and its actions in elsewhere give it to store which is in the Provider as prop. So that all the information can be imported by any component in the app. Redux usually useful for large scale apps with large code-base. It reduces and centralize the state management.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c1cddfba5712" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[react-hook-form]]></title>
            <link>https://medium.com/@atshn.gunduz/react-hook-form-9dff2a96dbd4?source=rss-107b6d28815b------2</link>
            <guid isPermaLink="false">https://medium.com/p/9dff2a96dbd4</guid>
            <category><![CDATA[react]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[front-end-development]]></category>
            <category><![CDATA[react-hook-form]]></category>
            <category><![CDATA[reactjs]]></category>
            <dc:creator><![CDATA[Ateshan Gunduz]]></dc:creator>
            <pubDate>Sun, 04 Feb 2024 08:23:37 GMT</pubDate>
            <atom:updated>2024-02-04T08:23:37.114Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/832/1*3fM1CF3XreChhcOJzpPMGg.png" /></figure><p>It is a library provides utilities that make it easier to work with forms. Helps us to reduce the amount of boilerplate code related to forms. It eliminates the need of manually handling states for each input and therefor reducing the unnecessary code. Usually used needed in larger forms with many different inputs. It also provides functions and objects to make us able to manipulate our form and input in cleaner way.</p><pre>npm install react-hook-form</pre><p>Install the library.</p><pre>const {register, handleSubmit} = useForm&lt;Address&gt;() // basic version<br><br><br>const {register, handleSubmit, formState: {errors, isSubmitting}, setError}= useForm&lt;FormFields&gt;()</pre><p>You can access those function and objects with useForm. Which will be usefull in the form. The register function will let us to get values from all inputs without using onChange and useState. handleSubmit will handle the submitting without the need for e.preventDefault. It will internally solve those issues for us.</p><pre>const handleTheSubmiting: SubmitHandler&lt;FormFields&gt; = (data)=&gt;{<br>    console.log(data);<br>}<br><br>return (<br>&lt;form onSubmit={handleSubmit(handleTheSubmiting)}&gt;<br>        &lt;h2&gt;Log-In to your Profile&lt;/h2&gt;<br>        &lt;input {...register(&quot;email&quot;, {required: &quot;Email is required&quot;, validate: (value)=&gt; {if(!value.includes(&quot;@&quot;)){<br>          return &quot;Email must include @&quot;<br>        } return true<br>        }})} type=&quot;text&quot; placeholder=&quot;Email&quot;/&gt;<br>     {errors.email &amp;&amp; &lt;p className=&quot;text-red-600&quot;&gt;{errors.email.message}&lt;/p&gt;}<br>      &lt;button disabled={isSubmitting} className=&quot;pr-4 pl-4 p-1&quot;&gt;<br>            {isSubmitting ? &quot;Loading&quot; : &quot;Log In&quot;}<br>        &lt;/button&gt;<br>    &lt;/form&gt;<br>)</pre><p>We call our handlesubmit function in form tag onSubmit event with our function that handles the submitting. All input gets {…register(“email”)} to get the values user set. We can use “required” with string to let our input gives our string as an error if input send empty. Or we can use “validate” to create function that conditionally returns a string as an error. if the value from the input does not include “@” return ”Email must include @ “.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9dff2a96dbd4" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[react-query]]></title>
            <link>https://medium.com/@atshn.gunduz/react-query-82ed253792cc?source=rss-107b6d28815b------2</link>
            <guid isPermaLink="false">https://medium.com/p/82ed253792cc</guid>
            <category><![CDATA[react]]></category>
            <category><![CDATA[react-query]]></category>
            <category><![CDATA[frontend]]></category>
            <category><![CDATA[front-end-development]]></category>
            <category><![CDATA[reactjs]]></category>
            <dc:creator><![CDATA[Ateshan Gunduz]]></dc:creator>
            <pubDate>Sat, 27 Jan 2024 09:13:55 GMT</pubDate>
            <atom:updated>2024-01-27T09:13:55.928Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/792/1*4hdr76CI7qveC5s8oigXqw.png" /></figure><p>When dealing with server-side data, react-query helps us to manage complex data. It comes with its hooks to make fetching and updating data easier for. Focusing on solely fetching attribute, besides its many abilities/ways to fetch data, we can see how react-query makes us code simpler related to our default way of fetching data.</p><pre>const myComponent= () =&gt; {<br>  const [isLoading, setIsLoading] = useState(true)<br>  const [data, setData] = useState([])<br>  const [error, setError] = useState(&quot;&quot;)<br><br>  useEffect(() =&gt; {<br>    axios.get(&#39;http://localhost:3001/herbs&#39;).then(res =&gt; {<br>      setData(res.data)<br>      setIsLoading(false)<br>    }).catch(error =&gt;{<br>      setError(error.message)<br>      setIsLoading(false)<br>    })<br>  }, [])<br><br>  if (isLoading) {<br>    return &lt;h2&gt;Loading...&lt;/h2&gt;<br>  }<br><br>  if(error){<br>    return &lt;h2&gt;{error}&lt;/h2&gt;<br>  }</pre><p>Without react-query we use useEffect and 3 useState hooks to manage our fetching. useEffect prevents unnecessary re-fetching and useStates helps us manage states. useStates also cause us our component to re-render. So lets look at same scenario with react-query.</p><pre>  const fetchData = ()=&gt;{<br>  return axios.get(&#39;http://localhost:3001/herbs&#39;) <br>}<br><br>const myComponent = ()=&gt; {<br>   const {isLoading, data, isError} = useQuery(&quot;herbs&quot;, fetchData)<br><br>if (isLoading) {<br>    return &lt;h2&gt;Loading...&lt;/h2&gt;<br>  }<br><br>  if (isError) {  <br>    return &lt;h2&gt;{error.message}&lt;/h2&gt;<br>  }<br><br>}</pre><p>We wrote less code and did not required useEffect and 3 useStates to what we achieved in the code above. useQuery hook helped us to manage data using fecthData function and allowed us to reach it by destructuring. We can use the data in “const {isLoading, data, isError}” to display results in our return. It also handled the triggering the data fetching logic so we did needed useEffect.</p><p>Note that react-query opens many opportunities to manage our data in many specific detailed ways. This example is just to demonstrate basic differences.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=82ed253792cc" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[axios react-query json-server]]></title>
            <link>https://medium.com/@atshn.gunduz/axios-react-query-json-server-fad9428550da?source=rss-107b6d28815b------2</link>
            <guid isPermaLink="false">https://medium.com/p/fad9428550da</guid>
            <category><![CDATA[http-request]]></category>
            <category><![CDATA[json-server]]></category>
            <category><![CDATA[restful-api]]></category>
            <category><![CDATA[axios]]></category>
            <category><![CDATA[react-query]]></category>
            <dc:creator><![CDATA[Ateshan Gunduz]]></dc:creator>
            <pubDate>Sun, 21 Jan 2024 11:15:50 GMT</pubDate>
            <atom:updated>2024-01-21T11:15:50.233Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/712/1*Llr1ZTcNT61PYqzfa3OCBA.png" /></figure><p>In react applications combining, axios, react-query and json server is frequent to work with mock API. Json-server grant us ability to set up a RESTful API using a JSON file as a database. Axios simplifies the process of asynchronous HTTP requests with methods such as get, post, put, and delete. React-query on the other hand helps us to manage our data with fetching, caching and invalidation. How can we demonstrate a simple example for this use case?</p><pre>npm install axios react-query json-server</pre><p>After installing them we can create a json file with our desired setup.</p><pre>{<br>  &quot;address&quot;: [<br>    {<br>      &quot;id&quot;: &quot;67e6&quot;,<br>      &quot;addName&quot;: &quot;My Address&quot;,<br>      &quot;street&quot;: &quot;&quot;,<br>      &quot;apartment&quot;: &quot;&quot;,<br>      &quot;city&quot;: &quot;&quot;,<br>      &quot;country&quot;: &quot;&quot;<br>    },<br>  ]<br>}</pre><p>We establish a localhost where our json-server will run. Then we make a http request to get our data from our json folder.</p><pre>const addressApi = axios.create({<br>    baseURL: &quot;http://localhost:3001&quot;<br>})<br><br>export  const fetchAddress = async ()=&gt;{<br>    const response = await addressApi.get(`/address`);<br>    return response.data;<br>}</pre><p>We use react-query useQuery() for handling the fetching process together with axios.</p><pre>export function useAddress(){<br>    return useQuery({<br>        queryKey: [&quot;address&quot;],<br>        queryFn: fetchAddress<br>    })<br>}</pre><p>In our component we import our needed functions and display our data with react-query.</p><pre>const { data: theAddress, error, isLoading } = useAddress();<br><br> if (isLoading) {<br>        console.log(&#39;Loading...&#39;);<br>        return &lt;p&gt;Loading...&lt;/p&gt;;<br>      }<br>      if (error) {<br>        return &lt;p&gt;Error&lt;/p&gt;;<br>      }<br><br>      console.log(&#39;Address:&#39;, theAddress);</pre><p>If achieved so far and can see our data in the console, we are ready to display the data in our component.</p><pre>  return (<br>     &lt;div className=&quot;last-confirm flex flex-col items-center gap-2&quot;&gt;<br>       &lt;button className=&quot;bg-blue-500 text-white p-2 rounded-lg font-semibold&quot; onClick={handleConfirm}&gt;Go Back&lt;/button&gt;<br>       &lt;div&gt;<br>         &lt;h2 className=&quot;font-semibold text-lg text-gray-700&quot;&gt;Delivery Adress&lt;/h2&gt;<br>         &lt;div className=&quot;text-lg m-1&quot;&gt;<br><br>         &lt;select name=&quot;amount&quot; className=&quot;text-blue-800&quot;&gt;<br>          {theAddress.map((adds:Address)=&gt;{<br>            return(<br>              &lt;option key={adds.id}&gt;{adds.addName}&lt;/option&gt;<br>            )<br>          })}<br>          &lt;/select&gt;<br>......</pre><p>Then, we can run our json-server with the port we created above.</p><pre>json-server -w data/db.json -p 3001</pre><p>On a other bash run your app and see the dispay of your data.</p><pre>npm start</pre><p>Now we want be able to add our json folder. We created a function that post to our server using axios.</p><pre>const addressApi = axios.create({<br>    baseURL: &quot;http://localhost:3001&quot;<br>})<br><br>export  const fetchAddress = async ()=&gt;{<br>    const response = await addressApi.get(`/address`);<br>    return response.data;<br>}<br><br>export const createAddress = async (data: Address[])=&gt;{<br>    await addressApi.post(`/address`, data);<br>    <br>}</pre><p>Now we create another function includes react-query useMutation. Imported createAddress function above an used it in mutationFn. onSuccess with queryClient.invalidateQueries({queryKey: [“address”]} let use update the our display as soon as the posting happens.</p><pre>export function useAddress(){<br>    return useQuery({<br>        queryKey: [&quot;address&quot;],<br>        queryFn: fetchAddress<br>    })<br>}<br><br>export function useCreateAddress(){<br>    const queryClient = useQueryClient()<br><br>    return useMutation({<br>        mutationFn: (data: Address[])=&gt; createAddress(data),<br>        onSuccess: async()=&gt;{<br>           await queryClient.invalidateQueries({queryKey: [&quot;address&quot;]})<br>        }<br>    })<br>}</pre><p>In our component we import useCreateAddress and use it in a function that handles our submitting from a form.</p><pre>const {register, handleSubmit} = useForm&lt;Address&gt;()<br>const createAddressMutation = useCreateAddress()<br>const handleCreateAddressSubmit: SubmitHandler&lt;any&gt; = (data,e) =&gt;{<br>        e?.preventDefault()<br>        createAddressMutation.mutate(data)<br>     }</pre><pre>return(... <br>&lt;form onSubmit={handleSubmit((data, e) =&gt; handleCreateAddressSubmit(data, e))}&gt;<br>          &lt;div&gt;<br>         &lt;input placeholder=&quot;name&quot; {...register(&quot;addName&quot;)} /&gt;<br>         &lt;/div&gt;<br>         &lt;div&gt;<br>         &lt;input placeholder=&quot;street&quot; {...register(&quot;street&quot;)} /&gt;<br>         &lt;/div&gt;<br>         &lt;div&gt;<br>        &lt;input placeholder=&quot;apartment&quot; {...register(&quot;apartment&quot;)} /&gt;<br>         &lt;/div&gt;<br>         &lt;div&gt;<br>       &lt;input placeholder=&quot;city&quot; {...register(&quot;city&quot;)} /&gt;<br>        &lt;/div&gt;<br>        &lt;div&gt;<br>        &lt;input placeholder=&quot;country&quot; {...register(&quot;country&quot;)} /&gt;<br>        &lt;/div&gt;<br>        &lt;button className=&quot;bg-orange-400 text-white p-2 rounded-lg font-semibold m-4&quot;&gt;Submit&lt;/button&gt;<br>  &lt;/form&gt;<br>...)</pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=fad9428550da" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[useMemo vs useCallback and memo]]></title>
            <link>https://medium.com/@atshn.gunduz/usememo-vs-usecallback-and-memo-0320cf0d3a06?source=rss-107b6d28815b------2</link>
            <guid isPermaLink="false">https://medium.com/p/0320cf0d3a06</guid>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[react-hook]]></category>
            <category><![CDATA[react]]></category>
            <category><![CDATA[front-end-development]]></category>
            <category><![CDATA[performance-optimization]]></category>
            <dc:creator><![CDATA[Ateshan Gunduz]]></dc:creator>
            <pubDate>Tue, 16 Jan 2024 09:49:48 GMT</pubDate>
            <atom:updated>2024-01-16T09:49:48.283Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/905/1*MgSS_zTiQGftK084c6HXKA.png" /></figure><p>When we create a dynamic app in react we use useState hook in many occasions. We use it to get values from inputs, re-arrange arrays, display values and set to them different values. When we set a new value with it, the component re-renders. There might be many buttons that set values and there might also be many expensive calculations such as filtering and sorting. So every time an unrelated value set to a new value in our component, re-render occurs. When the component re-renders, all other calculations in app also re-calculates. This might cause a performance issues especially if the calculation or the data it uses is heavy. Therefore useMemo and useCallback hooks comes handy.</p><p>They are used to optimize performance by memoizing values and functions, respectively.</p><h4>useMemo</h4><p>It memoize the result of the function it wraps. It takes dependencies and only renders when those dependencies changes. So that unrelated changed value wont trigger our function wrapped in useMemo.</p><pre>import { useMemo, useState } from &#39;react&#39;<br><br>const Component = ({ prop1, prop2 }) =&gt; {<br>const [value, setValue] = useState(0)<br><br>  const memoizedValue = useMemo(() =&gt; {<br>    return someExpensiveFunction(prop1, prop2)<br>  }, [prop1, prop2])<br><br>  return(<br>   &lt;&gt;<br>     &lt;button onClick={()=&gt;setValue(5)}&gt;Click to Change&lt;/button&gt;<br>     {value}<br>   &lt;/&gt;<br>  )<br>};</pre><p>So, when the button is clicked and component re-renders it makes 0 to 5. But it does not compute someExpensiveFunction, because its dependencies did not changed.</p><h4>useCallback</h4><p>It memoize the function itself. Especially important when the function send to child component as a prop.</p><pre>import { useCallback, useState} from &#39;react&#39;<br>import Child from &#39;./Child&#39;<br><br>const Parent = () =&gt; {<br>const [value, setValue] = useState(0)<br><br>  const handleExpensive = useCallback((text) =&gt; {<br>    return setValue(text)<br>  }, [])<br><br>console.log(&quot;Parent rendered&quot;)<br><br>  return(<br>   &lt;&gt;<br>     &lt;button onClick={()=&gt;setValue(value + 5)}&gt;Click to Change&lt;/button&gt;<br>     &lt;Child handleExpensive={handleExpensive}/&gt;<br>     {value}<br>    <br>   &lt;/&gt;<br>  )<br>}<br><br>//<br><br>import { memo } from &quot;react&quot;<br><br>const Child = ({handleExpensive}) =&gt; {<br>    console.log(&quot;Child rendered&quot;)<br>    <br>      return(<br>       &lt;&gt;<br>         &lt;input type=&quot;text&quot; onChange={(e)=&gt;handleExpensive(e.target.value)}/&gt;<br>       &lt;/&gt;<br>      )<br>    }<br><br>    export default memo(Child)</pre><p>So what we try to achieve here is that preventing our Child component to re-render when the button on Parent components triggers. We may say that useCallback hook have more specific use cases in scenarios of much crowded codes with many dependencies. However, keep in mind that this code is just a small demonstration without a dependency needed. We need to image that our Child component has some expensive calculations in it. We would not want it to re-render every time a button in Parent component triggers. memo in our case co-works with the useCallback.</p><h4>memo</h4><p>It helps components to prevent unnecessary renders. It checks if the props are different between renders.</p><p>In our case of useCallback it memo checks the function passed as a prop. By default functions are considered different in every render. So useCallback that is wrapped our function creates a new function that is identical. Which prevents the re-render.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=0320cf0d3a06" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[namespace interface type]]></title>
            <link>https://medium.com/@atshn.gunduz/namespace-interface-type-f4896307936a?source=rss-107b6d28815b------2</link>
            <guid isPermaLink="false">https://medium.com/p/f4896307936a</guid>
            <category><![CDATA[frontend-development]]></category>
            <category><![CDATA[typescript]]></category>
            <category><![CDATA[frontend]]></category>
            <category><![CDATA[react]]></category>
            <category><![CDATA[front-end-development]]></category>
            <dc:creator><![CDATA[Ateshan Gunduz]]></dc:creator>
            <pubDate>Thu, 04 Jan 2024 10:19:15 GMT</pubDate>
            <atom:updated>2024-01-04T10:19:15.751Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/645/1*_U84F6XctVahO1UXzq47Ww.png" /></figure><p>In TypeScript, namespace, interface and type serve to define types within our code. Each of them useful for different purposes and has their own use cases.</p><h4>namespace</h4><p>Primarily it do not focus on providing types. It provides a scope to avoid naming collisions and organize the code in a modular way. Typically used in larger codebases to form logical grouping.</p><pre>namespace division {<br>  export const findDivisibleNumbers = (): number[] =&gt; {<br>    const divisibleNumbers: number[] = []<br><br>    for (let i = 1; i &lt;= 100; i++) {<br>      if (i % 3 === 0 &amp;&amp; i % 5 === 0) {<br>        divisibleNumbers.push(i)<br>      }<br>    }<br><br>    return divisibleNumbers;<br>  }<br>}</pre><h4>interface</h4><p>It is specifically to define in objects. They declare the shape of object must have such as names types and its properties. Widely used in TypeScript.</p><pre>  export interface familyMember {<br>    name: string;<br>    birthYear: number;<br>    gender: number;<br>  }<br><br>  const currentYear: number = new Date().getFullYear();<br><br>  const youngestMember: averageAge.familyMember = familyMembers.reduce(<br>    (min, member) =&gt; (member.birthYear &gt; min.birthYear ? member : min),<br>    familyMembers[0]<br>  );<br>  console.log(youngestMember)</pre><h4>type</h4><p>It is commonly used for creating custom types. They are more flexible than interfaces. Can be used both to define objects structures and unions, intersections and other types. Preferred when creating aliases for existing types in complex type relations. Since it encapsulate interface some developers use it as default instead of interface.</p><pre>export type Name = {<br>    first: string<br>    last: string<br>}<br><br>export type PersonProps = {<br>    name: Name<br>}</pre><p>Overall they all contribute to static typing ability of TypeScript. namespaces allow code organization, interface and types are focus on type system.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f4896307936a" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>