<?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 T. Emre Yildirim on Medium]]></title>
        <description><![CDATA[Stories by T. Emre Yildirim on Medium]]></description>
        <link>https://medium.com/@temreyildirim8?source=rss-dc51bf06985b------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*lsUouTxinr60RS4gbm0_tA.jpeg</url>
            <title>Stories by T. Emre Yildirim on Medium</title>
            <link>https://medium.com/@temreyildirim8?source=rss-dc51bf06985b------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 17 Nov 2026 08:19:17 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@temreyildirim8/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[Building an Interactive BarChart Component: A Developer’s Tale]]></title>
            <link>https://medium.com/@temreyildirim8/building-an-interactive-barchart-component-a-developers-tale-6ba3e7a34185?source=rss-dc51bf06985b------2</link>
            <guid isPermaLink="false">https://medium.com/p/6ba3e7a34185</guid>
            <category><![CDATA[react-native]]></category>
            <category><![CDATA[reactjs]]></category>
            <category><![CDATA[d3js]]></category>
            <category><![CDATA[react]]></category>
            <category><![CDATA[svg]]></category>
            <dc:creator><![CDATA[T. Emre Yildirim]]></dc:creator>
            <pubDate>Sun, 23 Jun 2024 11:31:30 GMT</pubDate>
            <atom:updated>2024-06-27T11:07:07.596Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*v73px77-WeM7xZcd8Nso2w.png" /></figure><p>It takes a combination of ingenuity, accuracy, and problem-solving skills to create an interactive and captivating BarChart component in React Native. In the process of creating a feature-rich BarChart, we overcame difficulties with dynamic data display, tooltip implementation, and guaranteeing a consistent user experience across platforms. This post explains our methodology, our discoveries, and the solutions we came up with.</p><h4>The Idea</h4><p>The objective was to create a visually appealing BarChart component that enables interactive tooltips and efficiently visualizes data. Our goal was to develop a component that would allow for dynamic handling of different data inputs while maintaining a seamless user interface.</p><h4>Step 1: Establishing the Fundamental Framework</h4><p>First, we used React Native to create the basic framework of the BarChart component and D3 to draw SVG elements. This is a little excerpt of the preliminary setup:</p><pre>import React, { useEffect, useMemo, useState } from &#39;react&#39;;<br>import { View, StyleSheet, Dimensions } from &#39;react-native&#39;;<br>import Svg, { Rect, Text, G, Line, Path, Polygon } from &#39;react-native-svg&#39;;<br>import { scaleLinear, scaleUtc } from &#39;d3&#39;;<br>import moment from &#39;moment&#39;;<br>import { PanGestureHandler } &#39;react-native-gesture-handler&#39;;<br>// other imports such as utils and reducers<br><br>const SCREEN_WIDTH = Dimensions.get(&#39;window&#39;).width;<br>const MARGIN_BOTTOM = 20;<br>const MARGIN_TOP = 25;<br>const MARGIN_LEFT = 45;<br>const MARGIN_RIGHT = 25;<br>const HEIGHT = 300;</pre><h4>Step 2: Defining the Bar Shapes</h4><p>The key visual elements in a BarChart are the bars themselves. We defined the bars using SVG Rect elements and D3&#39;s scaleLinear and scaleUtc to map data points to screen coordinates:</p><pre>const { xAxis, yAxis, x, y, yZero } = useMemo(() =&gt; {<br>  const x = scaleUtc()<br>    .domain([new Date(data.t[0] * 1000), new Date(data.t[data.t.length - 1] * 1000)])<br>    .range([MARGIN_LEFT, SCREEN_WIDTH - 75]);<br>  const y = scaleLinear()<br>    .domain(yDomain)<br>    .range([HEIGHT - MARGIN_BOTTOM, MARGIN_TOP]);<br><br>  const xAxis = [<br>    [x(new Date(data.t[0] * 1000)), new Date(data.t[0] * 1000)],<br>    [x(new Date(data.t[data.t.length - 1] * 1000)), new Date(data.t[data.t.length - 1] * 1000)],<br>  ];<br><br>  const yTicks = y.ticks(6);<br>  const yAxis = yTicks.map((d) =&gt; [y(d), d]);<br><br>  return {<br>    xAxis,<br>    yAxis,<br>    x,<br>    y,<br>    yZero: y(0),<br>  };<br>}, [data]);</pre><h4>Step 3: Putting Tooltips to Use</h4><p>Tooltips improve user interaction by offering contextual information. Tooltips were displayed and touch events were managed using PanGestureHandler. In order to guarantee responsiveness, we triggered tooltips on long press using activateAfterLongPress:</p><pre>const handleGesture = (event) =&gt; {<br>  const { x: tapX } = event.nativeEvent;<br>  const closestIndex = data.t.findIndex((timestamp, i) =&gt; {<br>    const nextTimestamp = data.t[i + 1] ? data.t[i + 1] * 1000 : timestamp * 1000;<br>    const currentX = x(new Date(timestamp * 1000));<br>    const nextX = x(new Date(nextTimestamp));<br>    return tapX &gt;= currentX &amp;&amp; tapX &lt;= nextX;<br>  });<br><br>  if (closestIndex &gt;= 0) {<br>    const date = moment(data.t[closestIndex] * 1000).format(format);<br>    const value = formatCurrency(data.c[closestIndex], 2);<br>    setTooltip({<br>      date,<br>      value,<br>      x: x(new Date(data.t[closestIndex] * 1000)),<br>      y: y(data.c[closestIndex]),<br>    });<br>  }<br>};</pre><h4>Step 4: Making Sure It is Compatible</h4><p>One of the biggest challenges was making sure that various devices — including Huawei phones — worked together. To account for varying screen sizes and touch reactions, the gesture handling code had to be thoroughly tested and adjusted.</p><h4>In summary</h4><p>It takes both technical know-how and innovative problem-solving skills to create an interactive and aesthetically pleasing BarChart component. Each stage improved the functionality and appearance of the component, from specifying the bar shapes to adding responsive tooltips and incorporating pattern pictures.</p><p>I hope this journey provides valuable insights and inspiration for your own projects. Happy coding!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6ba3e7a34185" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Crafting a Dynamic LineChart Component: A Developer’s Tale]]></title>
            <link>https://medium.com/@temreyildirim8/crafting-a-dynamic-linechart-component-a-developers-journey-3a8fbbd7865e?source=rss-dc51bf06985b------2</link>
            <guid isPermaLink="false">https://medium.com/p/3a8fbbd7865e</guid>
            <category><![CDATA[d3js]]></category>
            <category><![CDATA[charts]]></category>
            <category><![CDATA[line-charts]]></category>
            <category><![CDATA[react-native]]></category>
            <category><![CDATA[reactjs]]></category>
            <dc:creator><![CDATA[T. Emre Yildirim]]></dc:creator>
            <pubDate>Fri, 21 Jun 2024 15:57:12 GMT</pubDate>
            <atom:updated>2024-06-21T16:38:17.674Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*L02YAPQkM-GpwlSmeMTV9A.png" /></figure><p>Building a LineChart component in React Native (bare Expo) can be a challenging yet rewarding experience. Our journey involved tackling several interesting hurdles, from creating smooth curves to adding tooltips and integrating pattern images. In this article, we’ll walk you through our process, share some key insights, and highlight how we overcame various challenges.</p><h4><strong>The Original Concept</strong></h4><p>The main objective was to develop a LineChart component that could show financial data dynamically. It has to be smooth, interactive, and visually appealing. This entailed making sure everything functions flawlessly across all platforms and adding features like touch-activated tooltips and pattern images for areas beneath curves.</p><h4>Step 1: Setting Up the Basic Structure</h4><p>First, we used React Native to define the basic structure of the LineChart component and D3 to draw the SVG elements. This is a little example of how we configured the first element:</p><pre>import React, { useEffect, useMemo, useState } from &#39;react&#39;;<br>import Svg, { Defs, Line, Pattern, Path, Text, Rect, G, Image, ClipPath } from &#39;react-native-svg&#39;;<br>import { line, area, scaleLinear, scaleUtc, curveCardinal } from &#39;d3&#39;;<br>import { Dimensions, StyleSheet, View } from &#39;react-native&#39;;<br>import moment from &#39;moment&#39;;<br>// other app specific imports such as utils and reducers</pre><p>We memoized the scales and pathway calculations using useMemo to maximize performance. This guarantees that our component renders again only when required.</p><h4><strong>Step 2: Incorporate Curves</strong></h4><p>A primary goal we set out to achieve was to achieve a visually appealing and seamless line. The curveCardinal technique from D3 with a tension value is how we were able to accomplish this:</p><pre>const lineBaseFn = line()<br>  .x((_, i) =&gt; x(new Date(data?.t?.[i] * 1000)))<br>  .y((_, i) =&gt; y(data?.c?.[i]))<br>  .curve(curveCardinal.tension(0.75));</pre><h4>Step 3: Drawing a lineRoute and surrounding areaRoute</h4><p>We utilized the line and area generators in D3 to create the pathways for the line and the filled area under the curve. This is how we configured it:</p><pre>const areaBaseFn = area()<br>  .x((_, i) =&gt; x(new Date(data.t[i] * 1000)))<br>  .y0(y(minRange))<br>  .y1((_, i) =&gt; y(data.c[i]))<br>  .curve(curveCardinal.tension(0.75));<br><br>const fullAreaPath = areaBaseFn(data.c);<br><br>const lineBaseFn = line()<br>  .x((_, i) =&gt; x(new Date(data.t[i] * 1000)))<br>  .y((_, i) =&gt; y(data.c[i]))<br>  .curve(curveCardinal.tension(0.75));<br><br>const fullLinePath = lineBaseFn(data.c);</pre><p>These functions define how the line and area should be drawn based on the data points, ensuring a smooth and accurate representation.</p><h4>Step 4: Implementing Tooltips</h4><p>Tooltips are essential for providing detailed data points on user interaction. We used the PanGestureHandler from react-native-gesture-handler to handle touch events and display the tooltips. To enhance user experience, we used activateAfterLongPress to activate the tooltip after a long press.<br>Besides, we may apply Haptics here for an advanced UX if we want to.</p><pre>const handleGesture = (event) =&gt; {<br>  const { x: tapX } = event.nativeEvent;<br>  const closestIndex = data.t.findIndex((timestamp, i) =&gt; {<br>    const nextTimestamp = data.t[i + 1] ? data.t[i + 1] * 1000 : timestamp * 1000;<br>    const currentX = x(new Date(timestamp * 1000));<br>    const nextX = x(new Date(nextTimestamp));<br>    return tapX &gt;= currentX &amp;&amp; tapX &lt;= nextX;<br>  });<br><br>  if (closestIndex &gt;= 0) {<br>    const date = moment(data.t[closestIndex] * 1000).format(format);<br>    const value = `${formatCurrency(data.c[closestIndex], 2)}`;<br>    setTooltip({<br>      date,<br>      value,<br>      x: x(new Date(data.t[closestIndex] * 1000)),<br>      y: y(data.c[closestIndex]),<br>      index: closestIndex,<br>    });<br>  }<br>};</pre><h4>Step 5: Adding Pattern Images</h4><p>We made the decision to add pattern images to the space beneath the line in order to improve the visual appeal. To do this, an SVG pattern has to be defined and used to fill the space:</p><pre>&lt;Defs&gt;<br>  &lt;Pattern patternUnits=&quot;userSpaceOnUse&quot; width={SCREEN_WIDTH} height={HEIGHT}&gt;<br>    &lt;Image<br>      href={isGraphPositive ? require(&#39;../../../assets/imgs/financials/green.png&#39;) : require(&#39;../../../assets/imgs/financials/red.png&#39;)}<br>      width={SCREEN_WIDTH}<br>      height={HEIGHT}<br>    /&gt;<br>  &lt;/Pattern&gt;<br>&lt;/Defs&gt;</pre><h4>Step 6: Ensuring Compatibility</h4><p>One of the challenges we faced was ensuring that the gestures work seamlessly across different devices, including Huawei phones. This involved testing and tweaking the gesture handling code to accommodate various screen sizes and touch responses.</p><h4>Conclusion</h4><p>Blending technical expertise with creative problem-solving is necessary to create a visually beautiful and functioning LineChart component. Each phase increased the component’s complexity and richness, from incorporating pattern images to providing responsive tooltips and employing D3 for smooth curves. I hope that this trip will give you new perspectives and ideas for your own endeavors. Have fun with coding!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3a8fbbd7865e" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[React componentleri arası prop geçişi]]></title>
            <link>https://medium.com/kodcular/react-componentleri-aras%C4%B1-prop-ge%C3%A7i%C5%9Fi-a1462ddeac52?source=rss-dc51bf06985b------2</link>
            <guid isPermaLink="false">https://medium.com/p/a1462ddeac52</guid>
            <category><![CDATA[react-native]]></category>
            <category><![CDATA[frontend]]></category>
            <category><![CDATA[türkçe]]></category>
            <category><![CDATA[react]]></category>
            <category><![CDATA[javascript]]></category>
            <dc:creator><![CDATA[T. Emre Yildirim]]></dc:creator>
            <pubDate>Fri, 03 Jan 2020 08:46:09 GMT</pubDate>
            <atom:updated>2020-01-07T02:59:28.369Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jWUtyVDYsZAuBhDdg4csIw.png" /></figure><blockquote>Özellikle yeni başlayanlar için anlaşılması ve kullanımı güç gelebilen bir konu react’ta prop kullanımı. Türkçe kaynak bu noktada da kısıtlı olduğu için bu yazıyı yazmak istedim. Kısaca prop nedir ve niçin kullanılır konularını anlattıktan sonra üç başlık halinde propların componentler arası geçişlerini ele alacağım.</blockquote><h3>Prop nedir ve niçin kullanılır?</h3><p>Property kelimesinin kısaltması olarak react dünyasına dahil edilmiş olan prop, kısaca içinde bulunduğu component’in bir özelliğini temsil eder.</p><pre>class Welcome extends React.Component {<br>  render() {<br>    return &lt;h1&gt;Hello, {this.props.name}&lt;/h1&gt;;<br>  }<br>}</pre><p>Örneğin buradaki kullanımda, name prop’u Welcome component’inin name özelliğini temsil eder ve çağırıldığı yerde özelleştirilerek kullanılabilir(bu kısmın detaylarını daha sonra ele alacağız)</p><p>Prop konusunu kısaca izah ettikten sonra <em>(bu yazının amacı bu olmadığı için kısa tutuyorum, dileyenler daha detaylı açıklamaları </em><a href="https://tr.reactjs.org/docs/components-and-props.html"><em>tr.reactjs.org</em></a><em> adresinden okuyabilirler) </em>propların componentler arasında nasıl geçiş sağladığını inceleyelim.</p><h4>1. Parent’tan Child’a prop geçişi</h4><p>Bu kısma girerken parent, child ve sibling kavramlarının tanımını yapmak gerekir, açıklamaya çalışalım… Yukarıda örnek verdiğimiz ‘Welcome’ class’ını child kabul edersek, bu Welcome class’ını import edip kullandığımız ‘App’ class’ı ise parent olarak isimlendirilir. Welcome class’ı ile aynı seviyede bir ‘Goodbye’ class’ı yarattığımızı farz edelim, aynı şekilde name prop’u olsun. Bu class’ı da import edip App class’ı içerisinde kullanalım. Şekil 2&#39;de de görüldüğü gibi; App class’ı yine <strong>parent</strong>, Goodbye ve Welcome class’ları App’in <strong>child’ları</strong> olmuş ve kendi aralarında da <strong>sibling</strong> ilişkisi kurmuş oldu.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4udL1trlgt4lOFArqdXBRw.png" /><figcaption>şekil: 2</figcaption></figure><p>Şimdi Parant’tan Child’a prop geçişini reelize edelim:</p><pre>class App extends React.Component {<br>render() {<br>        <br>        return (<br>            &lt;div&gt;<br>                 &lt;Welcome name = &quot;Maradona&quot; /&gt;<br>            &lt;/div&gt;<br>        );    <br>    }<br>}</pre><pre>class Welcome extends React.Component {<br>render() {<br>        <br>        return (<br>            &lt;div&gt;<br>                Parent&#39;tan gelen isim: {this.props.name}</pre><pre>               {*/ Burada Maradona yazısı görünecek \*}                   </pre><pre>            &lt;/div&gt;<br>        );<br>    }<br>}</pre><p>Bu örneğimizde; App class’ı parent ve Welcome class’ı child olarak konumlandı. Parent’ın içinde child class’ını çağırıp bir değer ataması yapabildik, çünkü child’ın “name” prop’u bulunmaktaydı…</p><h4>2. Child’dan Parent’a prop geçişi</h4><p>Burada, child class’ımızdan parent’a doğru bir prop aktarmamız gerektiğini düşünelim. Bunu yukarıdaki örnekteki gibi yapamayız hiyerarşik olarak. Burada bizim işimizi kolaylaştıran bir fonksiyon türü var: “callback” ve bunu detaylandıralım.</p><p><strong><em>Adım 1:</em></strong> Parent class’ımızın içinde; ana işlemi yapacak olan bir callback fonksiyonu tanımlarız, örneğimizdeki adı “mainCallBackFunction”</p><p><strong><em>Adım 2: </em></strong>Parent class’ımızın içinde; child’ı çağırdığımız yerde fonksiyonları birbirine eşitleriz, yani: callback={this.mainCallbackFunction}</p><p><strong><em>Adım 3: </em></strong>Child class’ımızın içinde; “sendData” <em>(isminin bir önemi yok)</em> isimli bir fonksiyon yardımıyla callback prop’unu tetikleriz:</p><pre>class Parent extends React.Component {</pre><pre>state = { callbackMessage: &quot;&quot; }</pre><pre>mainCallbackFunction = (childData) =&gt; { <br>   this.setState({ callbackMessage: childData }) <br>}</pre><pre>render() {<br>        return (<br>            &lt;div&gt;</pre><pre>              &lt;Child callback={this.mainCallbackFunction}/&gt;<br>              &lt;p&gt; {this.state.callbackMessage} &lt;/p&gt; <br>              {*/ Burada &lt;p&gt;&#39;nin içinde MERHABA PARENT görünecek \*}</pre><pre>            &lt;/div&gt;<br>        );}<br>}</pre><pre>class Child extends React.Component{</pre><pre>sendData = () =&gt; {<br>   this.props.callback(&quot;MERHABA PARENT&quot;);    <br>}</pre><pre>render() { <br>  return <br>    &lt;div&gt;<br>     {this.sendData}</pre><pre>    &lt;/div&gt;</pre><pre>    }<br>};</pre><h4>2. Sibling’den Sibling’e prop geçişi</h4><p>Siblingler arasında <em>(yani iki tane child arası, yukarıda 1. kısımda anlatmıştık) </em>prop geçişi sağlamak için bazı yöntemler mevcut. Örneğin, parent’ta fonksiyonları ortaklayıp aşağıdaki classlarda kullanmak gibi. Ancak ben bundan hiç bahsetmeyeceğim ve sadece sık kullanılan bir yöntemi tekrar edip yazıyı bitireceğim:<strong> global state kullanımı.</strong> Bunun için Redux/Mobx yardımcı kütüphaneleri veya Context kullanılabilir. Temel mantık, global bir merkez üzerinden verileri taşımaktır aşağıdaki resimde gösterildiği gibi:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GsNq-tedJAnpQudxt_8LHQ.png" /></figure><p>Context: <a href="https://tr.reactjs.org/docs/context.html">https://tr.reactjs.org/docs/context.html</a></p><p>Redux: <a href="https://redux.js.org/">https://redux.js.org/</a></p><p>Mobx: <a href="https://mobx.js.org/README.html">https://mobx.js.org/README.html</a></p><p>Bunları anlatmak ve detaylandırmak fazla süreceğinden sadece ilgili linkleri bırakıp yazıyı bitiriyorum. Sorularınızı ve görüşlerinizi esirgemeyiniz :)</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a1462ddeac52" width="1" height="1" alt=""><hr><p><a href="https://medium.com/kodcular/react-componentleri-aras%C4%B1-prop-ge%C3%A7i%C5%9Fi-a1462ddeac52">React componentleri arası prop geçişi</a> was originally published in <a href="https://medium.com/kodcular">Kodcular</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Building of react-native-web & tricks]]></title>
            <link>https://medium.com/innovance-company-blog/building-of-react-native-web-tricks-7b3655513497?source=rss-dc51bf06985b------2</link>
            <guid isPermaLink="false">https://medium.com/p/7b3655513497</guid>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[react]]></category>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[react-native]]></category>
            <dc:creator><![CDATA[T. Emre Yildirim]]></dc:creator>
            <pubDate>Fri, 20 Dec 2019 11:00:28 GMT</pubDate>
            <atom:updated>2019-12-31T11:07:46.977Z</atom:updated>
            <content:encoded><![CDATA[<blockquote>In this story, I would like to write about react-native-web library. It is an amazing tool that is really and really helpful for “write once run anywhere” and we also use it in a professional banking app…</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/750/1*_3lhRz_1nNyJxYW_ZV5eOA.gif" /></figure><p><strong>Firstly, I would like to show a simple react-native-web project on Github: </strong><a href="https://github.com/temreyildirim8/react-native-for-web">https://github.com/temreyildirim8/react-native-for-web</a> which I will explain in this story step by step. Then I will try to give some tricks about react-native-web development after understanding construction.</p><p>Let’s move on with the building of the project. There are some approaches for the construction of react-native-web, I will explain my way… We need to locate the folder that we wanna build our project, then write below ones:</p><pre><em>react-native init reactNativeWeb // to create project</em></pre><pre>npm i react react-dom react-native-web react-redux redux redux-thunk --save <em>// libraries</em></pre><pre>npm i webpack babel-loader babel-preset-react babel-preset-es2015 --save <em>// configuring libraries</em></pre><p>After that, copy the default App.js to somewhere else and refactor defaultApp.js so that it simply imports and renders the src/App.js that you just created:</p><pre><strong><em>// App.js</em></strong></pre><pre>import React from &#39;react&#39;;<br>import HybridApp from &#39;./src/App&#39;;</pre><pre>const App = (props) =&gt; {<br>  return (<br>    &lt;HybridApp /&gt;<br>  );<br>}</pre><pre>export default App;</pre><p>Create a folder called src and copy default App.js into src/App.js :</p><pre><strong><em>// src/App.js</em></strong></pre><pre>import React, {Component} from &#39;react&#39;;<br>import {Platform, StyleSheet, Text, View} from &#39;react-native&#39;;</pre><pre>const instructions = Platform.select({<br>  ios: &#39;Press Cmd+R to reload,\n&#39; + &#39;Cmd+D or shake for dev menu&#39;,<br>  android:<br>   &#39;Double tap R on your keyboard to reload,\n&#39; +<br>   &#39;Shake or press menu button for dev menu&#39;,<br>});</pre><pre>export default class App extends Component {</pre><pre>render() {</pre><pre>return (</pre><pre>&lt;View style={styles.container}&gt;</pre><pre>&lt;Text style={styles.welcome}&gt;Welcome to React Native!&lt;/Text&gt;</pre><pre>&lt;Text style={styles.instructions}&gt;To get started, edit App.js&lt;/Text&gt;</pre><pre>&lt;Text style={styles.instructions}&gt;{instructions}&lt;/Text&gt;</pre><pre>&lt;/View&gt;</pre><pre>);</pre><pre>}</pre><pre>}</pre><pre><em>// I deleted styles from here, you can reach it at </em><a href="https://github.com/temreyildirim8/react-native-for-web"><em>the project on github</em></a><em> or from default App.js of your default project</em></pre><p>And create src/index.js :</p><pre><strong><em>// src/index.js</em></strong></pre><pre>import React from ‘react’;<br>import ReactDom from ‘react-dom’;<br>import App from ‘./App’;</pre><pre>ReactDom.render(&lt;App /&gt;, document.getElementById(“root”));</pre><p>Create a folder called public and create public/index.html for web render.</p><pre><strong><em>&lt;!-- public/index.html --&gt;</em></strong></pre><pre>&lt;!DOCTYPE html&gt;</pre><pre>&lt;html&gt;</pre><pre>&lt;head&gt;</pre><pre>&lt;meta charset=&quot;utf-8&quot; /&gt;</pre><pre>&lt;title&gt;RN For Web App&lt;/title&gt;</pre><pre>&lt;/head&gt;</pre><pre>&lt;body&gt;</pre><pre>&lt;div id=&quot;root&quot;&gt;&lt;/div&gt;</pre><pre>&lt;/body&gt;</pre><pre>&lt;/html&gt;</pre><pre>&lt;/html&gt;</pre><p>And we need to add below scripts to package.json in order to build and start platforms differently:</p><pre><strong><em>// package.json</em></strong></pre><pre>&quot;scripts&quot;: {<br>    &quot;start&quot;: &quot;node node_modules/react-native/local-cli/cli.js start&quot;, <em>// it already exists</em></pre><pre>&quot;start-web&quot;: &quot;react-scripts start&quot;,<br>    &quot;build-web&quot;: &quot;react-scripts build&quot;</pre><pre><em>// And you can write different scripts to run ios and android here</em></pre><pre>},</pre><p>After we arrange scripts, we need to specify routes and add redux to our project.</p><p>Create routes under /src and create paths, Routes.web.js, Routes.native.js under routes:</p><pre><strong><em>// src/routes/paths.js</em></strong></pre><pre>export default {<br>  DEFAULT: ‘/’,<br>  DASHBOARD: ‘/dashboard’,<br>  RESULTS: ‘/results’<br>}</pre><pre><strong><em>// src/routes/Routes.web.js</em></strong></pre><pre>import React from &quot;react&quot;;<br>import { BrowserRouter as Router, Route, Switch } from &quot;react-router-dom&quot;;<br>import paths from &#39;./paths&#39;;<br>import Dashboard from &#39;../screens/Dashboard/Dashboard&#39;;<br>import Results from &#39;../screens/Results/Results&#39;;</pre><pre>const Routes = () =&gt; (</pre><pre>&lt;Router&gt;</pre><pre>&lt;Switch&gt;</pre><pre>&lt;Route exact path={paths.DEFAULT} component={Dashboard} /&gt;</pre><pre>&lt;Route path={paths.RESULTS} component={Results} /&gt;</pre><pre>&lt;/Switch&gt;</pre><pre>&lt;/Router&gt;</pre><pre>);</pre><pre>export default Routes;</pre><pre><strong><em>// src/routes/Routes.native.js</em></strong></pre><pre>import React from &quot;react&quot;;<br>import { NativeRouter as Router, Route, Switch } from &quot;react-router-native&quot;;<br>import paths from &#39;./paths&#39;;<br>import Dashboard from &#39;../screens/Dashboard/Dashboard&#39;;<br>import Results from &#39;../screens/Results/Results&#39;;</pre><pre>const Routes = () =&gt; (</pre><pre>&lt;Router&gt;</pre><pre>&lt;Switch&gt;</pre><pre>&lt;Route exact path={paths.DEFAULT} component={Dashboard} /&gt;</pre><pre>&lt;Route path={paths.RESULTS} component={Results} /&gt;</pre><pre>&lt;/Switch&gt;</pre><pre>&lt;/Router&gt;</pre><pre>);</pre><pre>export default Routes;</pre><p>Create store under /src and create actions, generics, reducers under store, you can look at <a href="https://github.com/temreyildirim8/react-native-for-web">the Github link</a> for them. <em>(I don&#39;t give details about redux connection here, it is not our subject now)</em> Finally, we will write/src/App.js file and it should look like that:</p><pre><strong><em>// src/App.js</em></strong></pre><pre>import React, {Component} from &#39;react&#39;;<br>import { Provider } from &#39;react-redux&#39;;<br>import { createStore, combineReducers, applyMiddleware, compose } from &quot;redux&quot;;<br>import thunk from &quot;redux-thunk&quot;;<br>import Routes from &#39;./routes/Routes&#39;;<br>import dashboardReducer from &#39;./store/reducers/dashboardReducer&#39;</pre><pre><em>// Combine all reducers<br></em>const rootReducer = combineReducers({<br>  dashboard: dashboardReducer<br>});</pre><pre><em>// Logger for dispatching, console.logs are optional <br></em>const logger = state =&gt; {</pre><pre>return next =&gt; {</pre><pre>return action =&gt; {</pre><pre>console.log(&quot;Middleware dispatching&quot;, action);</pre><pre>const result = next(action);</pre><pre>console.log(&quot;[MiddleWare next state]&quot;, state.getState());</pre><pre>return result;</pre><pre>};</pre><pre>};</pre><pre>};</pre><pre><em>// Redux dev tools<br></em>const composeEnhancers = window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ || compose;</pre><pre><em>// Store instance<br></em>const store = createStore(rootReducer, composeEnhancers(applyMiddleware(logger, thunk)));</pre><pre>export default class App extends Component {</pre><pre>render() {</pre><pre>return (</pre><pre>&lt;Provider store={store}&gt;</pre><pre>&lt;Routes /&gt;</pre><pre>&lt;/Provider&gt;</pre><pre>);</pre><pre>}</pre><pre>}</pre><p>We need to write npm run start-webon the console to start our project on browser at localhost:3000 and if it looks like below, it is done: congrats!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pnlE76TABC9tVODcIjX5oA.png" /><figcaption>the output of our first project</figcaption></figure><h3>Secondly, I want to talk about some tricks about react-native-web:</h3><blockquote>We need to learn react-native equivalents of web tags:</blockquote><blockquote><strong>View</strong> for<em> &lt;div&gt; </em>and <strong>WebView</strong> for &lt;iframe&gt;<br><strong>Text</strong> for<em> &lt;span&gt;</em><br><strong>Image</strong> for<em> &lt;img /&gt;</em><br><strong>TouchableHighlight</strong> for <em>&lt;button&gt;</em><br><strong>ScrollView</strong> for<em> &lt;div style=”overflow: auto”&gt;</em></blockquote><blockquote>We can differentiate codes according to platforms like above part: Routes.web.js and Routes.native.js</blockquote><blockquote>Be careful about defining styles!!</blockquote><blockquote><strong>View</strong> — width, height, margin, padding, background, border, opacity<br><strong>Layout</strong> — flex(most dangerous for web), position(absolute, relative) and transform<br><strong>Text</strong> — color, font, lineHeight, textAlign, textShadow</blockquote><blockquote>p.s: if you seperate your files as .web.js, you can use web tags like &lt;div&gt; in it</blockquote><blockquote>You <strong>cannot</strong> use these native-only tags on web:</blockquote><blockquote><strong>Navigator</strong><em> — <br></em><strong>ListView</strong><em> — <br></em><strong>ActivityIndicatorIOS</strong><em> — <br></em><strong>SegmentedControlIOS</strong><em> </em>— <em><br></em><strong>RefreshControl</strong><em> — <br></em><strong>TabBarIOS</strong><em> </em>—</blockquote><blockquote>etc…</blockquote><blockquote>Sometimes, you may need to separate your code pieces (especially on forms) for different platforms. E.g select, dropdown, etc. components for web…</blockquote><p>If you have questions, suggestions or any other issue, do not hesitate to write a response or contact me. 🙋‍♂️</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7b3655513497" width="1" height="1" alt=""><hr><p><a href="https://medium.com/innovance-company-blog/building-of-react-native-web-tricks-7b3655513497">Building of react-native-web &amp; tricks</a> was originally published in <a href="https://medium.com/innovance-company-blog">Innovance Blog</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[React Native styled-components kullanımı (pt 2 / detaylı anlatım)]]></title>
            <link>https://medium.com/kodcular/react-native-styled-components-kullan%C4%B1m%C4%B1-pt-2-detayl%C4%B1-anlat%C4%B1m-43172cca020?source=rss-dc51bf06985b------2</link>
            <guid isPermaLink="false">https://medium.com/p/43172cca020</guid>
            <category><![CDATA[react-native]]></category>
            <category><![CDATA[yazılım]]></category>
            <category><![CDATA[js]]></category>
            <category><![CDATA[türkçe]]></category>
            <category><![CDATA[styled-components]]></category>
            <dc:creator><![CDATA[T. Emre Yildirim]]></dc:creator>
            <pubDate>Tue, 24 Sep 2019 11:24:28 GMT</pubDate>
            <atom:updated>2019-11-06T17:21:50.465Z</atom:updated>
            <content:encoded><![CDATA[<h3><strong>React Native/JS styled-components kullanımı (pt 2 / detaylı anlatım)</strong></h3><p><a href="https://medium.com/@temreyildirim8/react-native-styled-components-kullan%C4%B1m%C4%B1na-giri%C5%9F-5f206114e2cc">Daha evvelki yazımda giriş yapmış olduğum</a> styled-components kullanımının derinlerine ve püf noktalarına değinmeye çalışacağım bu yazımda. Ek olarak, yeni kullanmaya başlayanlar ve hali hazırda kullananlar için daha ileri seviye bir doküman oluşturmaya çabalayacağım.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/849/1*q_txtWwGHwkqfUCn55_jnw.png" /></figure><p>İlk olarak söylemek gerekir ki, ‘bir kere yaz her yerde kullan’ mantığına çok uygun bir kütüphane styled-components. Ayrıca yazdıklarımızı react-native-for-web’de de kullanabilmekteyiz. Yani hem native bileşenler hem de direkt web bileşenleri şekillendirilebilmekte styled-components yardımıyla, şöyle ki:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/419/1*T67dYBYfolxPPGqPclSfrA.png" /><figcaption>for web &amp; for hybrid</figcaption></figure><p>Bu girişten sonraki kısımda styled-components’in pek dikkat çekmeyen veya az bilinen özelliklerine vurgu yapmaya çalışacağım…</p><ul><li>Mesela auto-prefixing konusunda bize fazlaca yardımcı olan styled components, bu noktada işimizi oldukça kolaylaştırıyor. Geleneksel css dosyalarında dahi bunları detaylandırmamız gerekirken styled components bunu bizim yerimize yapıyor:</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/469/1*UppC8JUlbjGa9MM2Zo2eTA.png" /><figcaption>otomatik olarak yapılan prefix gösterimi..</figcaption></figure><ul><li>props yardımıyla optional bir style elde edebilmemize olanak sağlıyor:</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/617/1*lles7sv2MkMwzQGTMocj8g.png" /></figure><ul><li>props’u short-if yöntemiyle kullanıp daha komplike ancak daha kısa kodlar elde edebiliyoruz:</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/404/1*kagAjzMJFznJ0VivP3tpNg.png" /><figcaption>short-if</figcaption></figure><ul><li>‘attrs’ (type, classname vb.) html-css bileşenini de kullanabilmekteyiz:</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/626/1*os7QwR6hqx0mf6ewCcZ_Gw.png" /><figcaption>attribute’ları düzenlenmiş InputText ve Button(bir classname’i dinamik olarak düzenlendi)</figcaption></figure><ul><li>withComponent özelliği yardımıyla iki bileşeni kaynaştırabiliriz, örneğin bir ‘button’ ve bir ‘a’ bileşeni:</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/538/1*mzYU3pXmbtFqBoFALCvRkw.png" /></figure><ul><li>nested-rule ve media-query’ler yazabilmekteyiz:</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/271/1*Vd7Nu8DPeG-Dkznt50nuxg.png" /></figure><ul><li>theme context’ler eklenebilmekte ve override edilebilmekte:</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/511/1*_Fr4zGS-ttww7XT4X0qZIg.png" /></figure><ul><li>Compositon ve Mixin kullanılabilmekte:</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/612/1*ft3d4LaWNyTt2UJqOjYnHw.png" /></figure><ul><li>Son olarak söylemek istediğim konu ise oldukça önemli. styled ve inline styled alanları override edebilmekteyiz:</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/498/1*3fQDC8I93kEOjVmu64lMMQ.png" /></figure><h3>KAYNAKÇA:</h3><p><a href="https://blog.bitsrc.io/9-react-styled-components-ui-libraries-for-2018-4e1a0bd3e179">https://blog.bitsrc.io/9-react-styled-components-ui-libraries-for-2018-4e1a0bd3e179</a></p><p><a href="https://facebook.github.io/react-native/docs/style">https://facebook.github.io/react-native/docs/style</a></p><p><a href="https://www.styled-components.com/docs/basics">https://www.styled-components.com/docs/basics</a></p><p><a href="https://www.styled-components.com/docs/advanced">https://www.styled-components.com/docs/advanced</a></p><p>github.com/styled-components/styled-components</p><p>medium.com/@temreyildirim8/react-native-styled-components-kullanımına-giriş-5f206114e2cc</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=43172cca020" width="1" height="1" alt=""><hr><p><a href="https://medium.com/kodcular/react-native-styled-components-kullan%C4%B1m%C4%B1-pt-2-detayl%C4%B1-anlat%C4%B1m-43172cca020">React Native styled-components kullanımı (pt 2 / detaylı anlatım)</a> was originally published in <a href="https://medium.com/kodcular">Kodcular</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[React Native/JS styled-components kullanımına giriş]]></title>
            <link>https://medium.com/kodcular/react-native-styled-components-kullan%C4%B1m%C4%B1na-giri%C5%9F-5f206114e2cc?source=rss-dc51bf06985b------2</link>
            <guid isPermaLink="false">https://medium.com/p/5f206114e2cc</guid>
            <category><![CDATA[styled-components]]></category>
            <category><![CDATA[yazılım]]></category>
            <category><![CDATA[türkçe]]></category>
            <category><![CDATA[css]]></category>
            <category><![CDATA[react-native]]></category>
            <dc:creator><![CDATA[T. Emre Yildirim]]></dc:creator>
            <pubDate>Mon, 26 Aug 2019 13:37:02 GMT</pubDate>
            <atom:updated>2019-12-26T13:38:38.837Z</atom:updated>
            <content:encoded><![CDATA[<h3>React Native/JS styled-components Kullanımına Giriş</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8slP0diGduUQy3qk9N7HsQ.png" /></figure><p>İlk Türkçe yazımda bu konuda pek kaynak göremediğim için styled-components’i seçtim. React native geliştiricilerinin çoğunun takip ettiği gibi react-native’de css kullanımı için birkaç yol bulunmakta. Bunlardan en yaygın olanı view içinde inline css veya const içinde tanımladığımız inline css.</p><p>Örnek:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/b164e8410bb90eb50a86531d9a247059/href">https://medium.com/media/b164e8410bb90eb50a86531d9a247059/href</a></iframe><p>Eğer frontend geliştirmeye single-page frameworkler ile başlamış biri iseniz inline css’teki camelCaseKullanımı sizi pek rahatsız etmeyebilir çalışmanız açısından.</p><p>Ancak, frontend geliştirmeye div’ler ve hatta tablolar kullanarak başlamış biri iseniz bu kullanım sizin hoşunuza gitmeyebilir ve pratik de gelmeyebilir. Bunun dışında, syntax hatalarını gösteriyor olsa da alışkın olmadığınız için özellikle ilk etapta çok hata yapmanıza sebebiyet verebilir. Fakat styled-components kullanırsanız alışık olduğunuz div styling ile yolunuza devam edebilirsiniz.</p><p>Örnek:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/0e4addcaf3dc095990f55c66562d1c06/href">https://medium.com/media/0e4addcaf3dc095990f55c66562d1c06/href</a></iframe><p>Buna ek olarak, alışkın olduğumuz css tag’lerini de styled-components aracılığıyla kullanabiliriz (klasik css kullanımının yerine):</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/a9d824557dfa071a7e09829b6b8d5292/href">https://medium.com/media/a9d824557dfa071a7e09829b6b8d5292/href</a></iframe><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/2b57f7f78df0ea38704d055bfa50d790/href">https://medium.com/media/2b57f7f78df0ea38704d055bfa50d790/href</a></iframe><p>Inline css kullanımını birçok react-native tutorial’ı başlangıç aşaması için önermekte ancak bana kalırsa styled-components kullanmak bu noktada daha kolay ve yönetilebilir. Bu konunun detaylarıyla ilgili bir yazı daha yazmayı planlamaktayım, geri dönüşlerinizi memnuniyetle karşılarım…</p><p><strong>EDIT:</strong> <a href="https://medium.com/kodcular/react-native-styled-components-kullan%C4%B1m%C4%B1-pt-2-detayl%C4%B1-anlat%C4%B1m-43172cca020">Yazının devamına buraya tıklayarak ulaşabilirsiniz.</a></p><h3>KAYNAKÇA:</h3><ul><li><a href="https://blog.logrocket.com/8-reasons-to-use-styled-components-cf3788f0bb4d/">8 reasons to use styled-components - LogRocket Blog</a></li><li><a href="https://www.styled-components.com/">styled-components</a></li><li><a href="https://github.com/styled-components/styled-components?source=post_page---------------------------">styled-components/styled-components</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5f206114e2cc" width="1" height="1" alt=""><hr><p><a href="https://medium.com/kodcular/react-native-styled-components-kullan%C4%B1m%C4%B1na-giri%C5%9F-5f206114e2cc">React Native/JS styled-components kullanımına giriş</a> was originally published in <a href="https://medium.com/kodcular">Kodcular</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Gerrit — Code Review Tool]]></title>
            <link>https://medium.com/innovance-company-blog/gerrit-code-review-tool-f9a2e87f9c85?source=rss-dc51bf06985b------2</link>
            <guid isPermaLink="false">https://medium.com/p/f9a2e87f9c85</guid>
            <category><![CDATA[remote-working]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[code-review-tool]]></category>
            <category><![CDATA[gerrit]]></category>
            <category><![CDATA[code-review]]></category>
            <dc:creator><![CDATA[T. Emre Yildirim]]></dc:creator>
            <pubDate>Fri, 16 Aug 2019 13:34:37 GMT</pubDate>
            <atom:updated>2020-05-28T10:45:20.174Z</atom:updated>
            <content:encoded><![CDATA[<h3>Gerrit — Code Review Tool</h3><p>I would like to write about a specific code review tool in my first post: Gerrit code review. There are some popular professional tools like Review Assistant, Reshift, Sonarcube, JetBrains etc. but I want to examine Gerrit in some ways:</p><h3>ADVANTAGES:</h3><ol><li>It is easy to use:</li></ol><p><a href="https://www.gerritcodereview.com/">https://www.gerritcodereview.com/</a> from this official site, you can reach to build, docs and other resources to use it. It is really easy and does not cause big costs, in the first stage.</p><p>2. Manageable</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/521/1*8rYLpfAZkdoggHbuuVFfRQ.png" /><figcaption>Project(s) management</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/149/1*Lg17JVJ7Qi4N1sVSlnwSHw.png" /><figcaption>Access configuration</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/339/1*Vs6GZAkhFXItzwnG1shN7A.png" /><figcaption>Branch management</figcaption></figure><p>3. You can use it from a browser easily:</p><p>Gerrit provides extension option for your company’s owned domain. E.g: <a href="http://www.gerrit.yourcompanyaddress.com./">www.gerrit.yourcompanyaddress.com.</a> You can customize your code review platform like this.</p><p>4. Open-source (You can reach the details from its website)</p><h3>DISADVANTAGES:</h3><ol><li>You can by-pass Gerrit easily via forcing code like:</li></ol><p>git push feat/related branch (without HEAD:refs/for/origin)</p><p>2. Someway, it is hard to manage while working in different branches for different features especially when you need to merge them at a point.</p><p>All in all, I can recommend the Gerrit review tool to use in a professional project because as you can see advantages override disadvantages from my point of view. If you want to add or comment, please do not hesitate :)</p><h3>REFERENCES:</h3><ul><li><a href="https://www.gerritcodereview.com/">Gerrit Code Review</a></li><li><a href="https://gerrit-review.googlesource.com/Documentation/">Gerrit Code Review for Git</a></li><li><a href="https://github.com/GerritCodeReview">Gerrit Code Review</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f9a2e87f9c85" width="1" height="1" alt=""><hr><p><a href="https://medium.com/innovance-company-blog/gerrit-code-review-tool-f9a2e87f9c85">Gerrit — Code Review Tool</a> was originally published in <a href="https://medium.com/innovance-company-blog">Innovance Blog</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>