<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: sayCheese</title>
    <description>The latest articles on DEV Community by sayCheese (@saycheese).</description>
    <link>https://dev.to/saycheese</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F816365%2F6a1f38c1-2c2b-495c-9638-b97e32f2eb2b.png</url>
      <title>DEV Community: sayCheese</title>
      <link>https://dev.to/saycheese</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/saycheese"/>
    <language>en</language>
    <item>
      <title>Apple will only accept apps built with Xcode 13 starting next month</title>
      <dc:creator>sayCheese</dc:creator>
      <pubDate>Thu, 17 Mar 2022 11:06:45 +0000</pubDate>
      <link>https://dev.to/saycheese/apple-will-only-accept-apps-built-with-xcode-13-starting-next-month-2joo</link>
      <guid>https://dev.to/saycheese/apple-will-only-accept-apps-built-with-xcode-13-starting-next-month-2joo</guid>
      <description>&lt;p&gt;Starting next month, Apple will begin mandating apps submitted to the App Store to be built with Xcode 13.&lt;/p&gt;

&lt;p&gt;In an announcement on Tuesday, Apple revealed that come April, it will only accept apps that are built using Xcode 13, the latest version of Apple’s app development kit. The move will go into effect from April 25. By mandating Xcode 13, Apple will ensure that all new apps submitted to App Store are compatible with the latest versions of iOS, iPad OS, watchOS, tvOS, and macOS.&lt;/p&gt;

&lt;p&gt;Starting April 25, 2022, iOS, iPadOS, and watchOS apps submitted to the App Store must be built with Xcode 13, which includes the SDKs for iOS 15, iPadOS 15, and watchOS 8.&lt;/p&gt;

&lt;p&gt;Apple notes that developers can take advantage of all the new features and APIs introduced with iOS 15, watchOS 8, and macOS Monterey, including ARkit 5, SwiftUI, SharePlay, and Safari Extensions. Apps built with Xcode 13 will continue to support older versions of Apple software, such as iOS 14 and macOS Big Sur.&lt;/p&gt;

&lt;p&gt;“Make the most of the exciting features in iOS 15, iPadOS 15, and watchOS 8 to offer even more intuitive and valuable user experiences. Improve your app’s performance by refactoring your code to take advantage of asynchronous functions in Swift. And with the latest updates to SwiftUI, you can enhance your apps with new features, such as improved list views, better search experiences, and support for control focus areas,” wrote Apple in its blog post.&lt;/p&gt;

&lt;p&gt;The move comes after Apple released iOS 15.4 and iPadOS 15.5 to the public last week. The latest iOS version introduces several new features, including 112 new Unicode 14.0 emoji, Health and Wallet support for EU COVID-19 vaccination certificates, the ability to use Face ID when masked, Apple Card widget, support for setting up custom email domains, and other smaller, quality-of-life improvements.&lt;/p&gt;

</description>
      <category>reactnative</category>
      <category>javascript</category>
      <category>xcode13</category>
      <category>apple</category>
    </item>
    <item>
      <title>Redux in React</title>
      <dc:creator>sayCheese</dc:creator>
      <pubDate>Fri, 04 Mar 2022 09:51:20 +0000</pubDate>
      <link>https://dev.to/saycheese/redux-in-react-4na3</link>
      <guid>https://dev.to/saycheese/redux-in-react-4na3</guid>
      <description>&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Redux&lt;/strong&gt; is a predictable state container for JavaScript apps.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;u&gt;Redux is for JavaScript applications.&lt;/u&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Redux is not tied to React.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;It can be used with Vanilla JavaScript or any JS framework like Angular, React, Vue, etc. &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Redux is a library for JS applications.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;u&gt;Redux is a state container&lt;/u&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Redux stores the state of your application.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;For Example:- consider a react app - state of component&lt;br&gt;
&lt;em&gt;LoginFormComponent&lt;/em&gt;&lt;br&gt;
&lt;code&gt;state = {&lt;br&gt;
username:'',&lt;br&gt;
password:'',&lt;br&gt;
submitting: false&lt;br&gt;
}&lt;/code&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;State of an app is the state represented by all the individual component of that app.&lt;br&gt;
&lt;em&gt;UserListComponent&lt;/em&gt;&lt;br&gt;
&lt;code&gt;state = {&lt;br&gt;
users : []&lt;br&gt;
}&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Redux will store and manage this application state.&lt;br&gt;
&lt;em&gt;Application&lt;/em&gt;&lt;br&gt;
&lt;code&gt;state= {&lt;br&gt;
isUserLoggedIn = true,&lt;br&gt;
username: 'John',&lt;br&gt;
profileUrl: '',&lt;br&gt;
onlineUsers: [],&lt;br&gt;
isModalOpened: false&lt;br&gt;
}&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;u&gt;Redux is predictable - In what way?&lt;/u&gt;&lt;/p&gt;

&lt;p&gt;In redux, all state transitions are explicit and it is possible to keep track of them. (i.e) The changes to your application's state becomes predictable.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Redux can help you manage the state of your JavaScript application in a predictable way. &lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;strong&gt;&lt;u&gt;React + Redux&lt;/u&gt;&lt;/strong&gt;&lt;br&gt;
In React applications where you have considerable no. of components, which share some common state, State management could become troublesome. That's where Redux comes in.&lt;/p&gt;

&lt;p&gt;With Redux, your state will come from outside your components.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--nhc0HnJQ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/mr9pqum1gl1wb1tv2y8e.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--nhc0HnJQ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/mr9pqum1gl1wb1tv2y8e.PNG" alt="React + Redux" width="880" height="395"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Actually this solution can be doable in React itself with below ways. &lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;React context&lt;/strong&gt; - which prevents prop drilling.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;useContext + useReducer&lt;/strong&gt; - with these combining hooks.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;React-Redux&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;React-Redux is the official Redux UI binding library for React.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;u&gt;Three core concepts in Redux&lt;/u&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;A &lt;strong&gt;store&lt;/strong&gt; that holds the state of your application.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;An &lt;strong&gt;action&lt;/strong&gt; that describes the changes in the state of your application.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;A &lt;strong&gt;Reducer&lt;/strong&gt; which actually carries out the state transition depending on the action.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;&lt;u&gt;Summary&lt;/u&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;React is a library used to build user interfaces.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Redux is a library for managing state in a predictable way in JavaScript applications.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;React-Redux is a library that provides bindings to use React and Redux in an application.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Reference &lt;a href="https://www.youtube.com/watch?v=9boMnm5X9ak&amp;amp;list=PLC3y8-rFHvwheJHvseC3I0HuYI2f46oAK"&gt;Video&lt;/a&gt;.&lt;/p&gt;

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

</description>
    </item>
    <item>
      <title>React Native important concepts</title>
      <dc:creator>sayCheese</dc:creator>
      <pubDate>Mon, 21 Feb 2022 12:53:12 +0000</pubDate>
      <link>https://dev.to/saycheese/start-write-2ba9</link>
      <guid>https://dev.to/saycheese/start-write-2ba9</guid>
      <description>&lt;p&gt;Welcome Everyone!&lt;/p&gt;

&lt;p&gt;Some of React Native's important concepts as follows.&lt;/p&gt;

&lt;p&gt;&lt;u&gt;&lt;strong&gt;Props and State&lt;/strong&gt;&lt;/u&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;&lt;a href="https://reactnative.dev/docs/tutorial#props"&gt;props &lt;/a&gt;:&lt;/strong&gt; are immutable and are set by the parent and they are fixed throughout the lifetime of a component.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Components receive props from their parent. These props should not be modified inside the component. In React and React Native the data flows in one direction -&amp;gt; From the parent to the child.&lt;/p&gt;

&lt;p&gt;The idea behind props is that you can make a single component that is used in many different places in your app. The parent that is calling the component can set the properties, which could be different in each place.&lt;/p&gt;

&lt;p&gt;Props essentially help you write reusable code. &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;&lt;a href="https://reactnative.dev/docs/tutorial#state"&gt;state&lt;/a&gt; :&lt;/strong&gt; State can Change — &lt;strong&gt;Mutable&lt;/strong&gt;. The variable data can be stored in the state. It is mutable means a state can change the value at any time. It is used to control the components.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;State works differently when compared to props. State is internal to a component, while props are passed to a component. &lt;/p&gt;

&lt;p&gt;Anytime there is data that is going to change within a component, state can be used. &lt;/p&gt;




&lt;p&gt;&lt;u&gt;&lt;strong&gt;&lt;a href="https://reactnative.dev/docs/components-and-apis#basic-components"&gt;Components&lt;/a&gt;&lt;/strong&gt;&lt;/u&gt;&lt;/p&gt;

&lt;p&gt;React is built around components. React code is essentially a bunch of nested components.&lt;/p&gt;

&lt;p&gt;A component is essentially the same thing as a command in another programming language. It's just bundled with the visual output and handles the opening and closing on its own. You won't have to worry about incomplete syntax when using React native.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Component APIs:&lt;/strong&gt; React native interacts with its APIs in a unique way. Its got some of its own commands, like render and setState, which are particular to the language's unique configuration. There's also the constructor command which lets you define the state and bind methods.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Functional components&lt;/strong&gt; Increasing numbers of programmers are using React native using functional components. A functional component accepts a props object as an argument and outputs a bunch of HTML. It functions almost like a template, but one where you can use whatever JavaScript code you want.&lt;/p&gt;




&lt;p&gt;&lt;u&gt;&lt;strong&gt;&lt;a href="https://reactjs.org/docs/hooks-overview.html"&gt;Hooks&lt;/a&gt;&lt;/strong&gt;&lt;/u&gt;&lt;/p&gt;

&lt;p&gt;A Hook is a special function that lets you “hook into” React features. For example, _useState _is a Hook that lets you add React state to function components. &lt;/p&gt;

&lt;p&gt;If you write a function component and realize you need to add some state to it, previously you had to convert it to a class. Now you can use a Hook inside the existing function component. &lt;/p&gt;

&lt;p&gt;Hooks don’t replace your knowledge of React concepts. Instead, Hooks provide a more direct API to the React concepts you already know: props, state, context, refs, and lifecycle. Commonly following hooks are mostly used: &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;a href="https://reactjs.org/docs/hooks-state.html"&gt;State Hook&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;a href="https://reactjs.org/docs/hooks-effect.html"&gt;Effect Hook&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;a href="https://reactjs.org/docs/hooks-reference.html#usecontext"&gt;Context Hook&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;




&lt;p&gt;&lt;u&gt;&lt;strong&gt;&lt;a href="https://reactnative.dev/docs/flexbox"&gt;Layout with Flexbox&lt;/a&gt;&lt;/strong&gt;&lt;/u&gt;&lt;/p&gt;

&lt;p&gt;Flexbox works the same way in React Native as it does in CSS on the web, with a few exceptions. The defaults are different, with flexDirection defaulting to column instead of row, alignContent defaulting to flex-start instead of stretch, flexShrink defaulting to 0 instead of 1, the flex parameter only supporting a single number.&lt;/p&gt;

&lt;p&gt;As a newbie in React Native I found myself time after time going back to React Native layout docs, struggling to understand and master the difference between all the different props. justify vs align, relative vs absolute, items vs content, It was all very confusing. Use this &lt;em&gt;&lt;a href="https://medium.com/wix-engineering/the-full-react-native-layout-cheat-sheet-a4147802405c"&gt;cheat sheet&lt;/a&gt;&lt;/em&gt; for styling.&lt;/p&gt;




&lt;p&gt;&lt;u&gt;&lt;strong&gt;&lt;a href="https://www.geeksforgeeks.org/when-we-use-scrollview-over-flatlist-or-vice-versa/"&gt;FlatList and ScrollView&lt;/a&gt;&lt;/strong&gt;&lt;/u&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;ScrollView:&lt;/em&gt; The ScrollView Component is an inbuilt react-native component that serves as a generic scrollable container, with the ability to scroll child components and views inside it.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Flatlist:&lt;/em&gt; The FlatList Component is an inbuilt react-native component that displays similarly structured data in a scrollable list. It shows only those elements that are currently being displayed on the screen.&lt;/p&gt;

&lt;p&gt;As opposed to the ScrollView, the FlatList renders only those elements that are currently being displayed on the screen (default: 10 items). Thus, it does not have any impact on the performance of the application. So, it is preferable to use the FlatList Component to display a large list of data. &lt;/p&gt;




&lt;p&gt;&lt;strong&gt;&lt;a href="https://reactnavigation.org/docs/getting-started/"&gt;React Navigation&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;React Navigation is made up of some core utilities and those are then used by navigators to create the navigation structure in your app. &lt;/p&gt;

&lt;p&gt;&lt;code&gt;npm install @react-navigation/native&lt;/code&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://reactnavigation.org/docs/tab-based-navigation"&gt;Tab navigation&lt;/a&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://reactnavigation.org/docs/drawer-based-navigation"&gt;Drawer navigation&lt;/a&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://reactnavigation.org/docs/stack-navigator/"&gt;Stack Navigator&lt;/a&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://reactnavigation.org/docs/bottom-tab-navigator"&gt;Bottom Tabs Navigator&lt;/a&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://reactnavigation.org/docs/material-top-tab-navigator"&gt;Material Top Tabs Navigator&lt;/a&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

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

</description>
      <category>reactnative</category>
      <category>react</category>
    </item>
    <item>
      <title>Get request with Basic authorization for React Native Mobile application</title>
      <dc:creator>sayCheese</dc:creator>
      <pubDate>Wed, 16 Feb 2022 11:42:47 +0000</pubDate>
      <link>https://dev.to/saycheese/get-request-with-authorization-for-react-native-mobile-application-2f3c</link>
      <guid>https://dev.to/saycheese/get-request-with-authorization-for-react-native-mobile-application-2f3c</guid>
      <description>&lt;p&gt;Hey Dev Community,&lt;/p&gt;

&lt;p&gt;Welcome everyone. &lt;/p&gt;

&lt;p&gt;This article is about how to use Fetch API Get request with Basic authorization for React Native Mobile application.&lt;/p&gt;

&lt;p&gt;Basic Authentication is when raw(or with basic encoding) username and password is sent to the server, typically in its body&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt; headers: {
           Authorization: "Basic " + base64.encode(username + ":" + password),

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

&lt;/div&gt;



&lt;p&gt;Sending credential pair in 'Authorization' header of a request can be also considered as basic authentication request:&lt;/p&gt;

&lt;p&gt;It consists of a prefix &lt;strong&gt;Basic&lt;/strong&gt; (or some other word) and base64 encoding of username and password separated by colon &lt;strong&gt;(:)&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Authorization&lt;/strong&gt; key used in header can also be changed to some other name, while the server is configured to parse that key.&lt;/p&gt;

&lt;p&gt;Check below code with comments for how I used.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const HomeScreen = () =&amp;gt; {
  const [isLoading, setLoading] = useState(true);
  let [data, setData] = useState([]);

  let base64 = require("base-64"); // install it before use from npm i base-64

 const username = "some username goes here";
 const password = "some password goes here";

//function for Fetching data from API
const getMovies = async () =&amp;gt; {
   try {
     const response = await fetch(
       "API URL goes here",
       {
         headers: {
           Authorization: "Basic " + base64.encode(username + ":" + password),
         },
       }
     );
     data = await response.json();

     setData(data);

     return data;
   } catch (error) {
     console.error(error);
   } finally {
     setLoading(false);
   }
 };

//use Effect hook
 useEffect(() =&amp;gt; {
   getMovies();
 }, []);

return (
    &amp;lt;View style={styles.container}&amp;gt;
//rendering API data in FlatList view
        &amp;lt;FlatList
            keyExtractor={(item) =&amp;gt; item.id}
            data={data}
            contentContainerStyle={styles.listCtn}
            renderItem={({ item }) =&amp;gt; ( 
          &amp;lt;View style={styles.productImagesCtn}&amp;gt;
                &amp;lt;Image
                  style={styles.productImages}
                  source={{
                    uri: item.images[0].src,
                  }}
                /&amp;gt;
          &amp;lt;/View&amp;gt;
           )}
         /&amp;gt;
       &amp;lt;/View&amp;gt;
 );
};

export default HomeScreen;

const styles = StyleSheet.create({
  container: {
    flex: 1,
    backgroundColor: '#fff',
    alignItems: "center",
  },

  productImagesCtn: {
    width: Dimensions.get("window").width / 3,
    marginVertical: 20,
  },
  productImages: {
    width: "100%",
    height: 158,
  },
listCtn: {
    justifyContent: "space-around",
    flexDirection: "row",
    flexWrap: "wrap",
  },
});
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;References used from: &lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;a href="https://newbycoder.com/react_native/auth_basic"&gt;https://newbycoder.com/react_native/auth_basi&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://stackoverflow.com/questions/34815853/react-native-fetch-and-basic-authentication/71122256#71122256"&gt;https://stackoverflow.com/questions/34815853/react-native-fetch-and-basic-authentication/71122256#71122256&lt;/a&gt;.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Give a suggestions for edit in comments will definitely fix.&lt;/p&gt;

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

</description>
      <category>react</category>
      <category>reactnative</category>
    </item>
  </channel>
</rss>
