<?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>Forem: Diomedes Lajara</title>
    <description>The latest articles on Forem by Diomedes Lajara (@diomedes).</description>
    <link>https://forem.com/diomedes</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%2F76527%2F0bbb55d5-0ec8-4d08-a650-3bf807b72750.jpeg</url>
      <title>Forem: Diomedes Lajara</title>
      <link>https://forem.com/diomedes</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/diomedes"/>
    <language>en</language>
    <item>
      <title>State Rules!</title>
      <dc:creator>Diomedes Lajara</dc:creator>
      <pubDate>Tue, 08 Jan 2019 22:46:35 +0000</pubDate>
      <link>https://forem.com/dlomedes/state-rules-5doa</link>
      <guid>https://forem.com/dlomedes/state-rules-5doa</guid>
      <description>

&lt;p&gt;Rules of state&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Do not confuse props with state&lt;/li&gt;
&lt;li&gt;‘State’ is a JS object&lt;/li&gt;
&lt;li&gt;Only usable with class based components&lt;/li&gt;
&lt;li&gt;State has to be initialized when a component is created&lt;/li&gt;
&lt;li&gt;Never update state directly.&lt;/li&gt;
&lt;li&gt;State can only be updated with setState.&lt;/li&gt;
&lt;li&gt;Updating State causes the component to re-render.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;State object is defined inside the constructor function. &lt;br&gt;
Use states (this.state) to manage dynamic data.&lt;/p&gt;

&lt;p&gt;Constructor note&lt;br&gt;
The base class of React.Component has its own constructor and by defining a new constructor, it gets overridden. But to make sure that the “parent” constructor gets called we use super(props). Super with props is a reference to the parent constructor inside React.Component function.&lt;/p&gt;


</description>
      <category>state</category>
      <category>conditionalrendering</category>
      <category>react</category>
    </item>
    <item>
      <title>React Classes vs Funcomps</title>
      <dc:creator>Diomedes Lajara</dc:creator>
      <pubDate>Sat, 29 Dec 2018 01:56:59 +0000</pubDate>
      <link>https://forem.com/diomedes/react-classes-vs-funcomps-3cg4</link>
      <guid>https://forem.com/diomedes/react-classes-vs-funcomps-3cg4</guid>
      <description>&lt;p&gt;&lt;a href="https://thepracticaldev.s3.amazonaws.com/i/6q6a5bxfcd67920xaru6.png"&gt;https://thepracticaldev.s3.amazonaws.com/i/6q6a5bxfcd67920xaru6.png&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;To write a Functional or to write a Class based component.&lt;/p&gt;

&lt;p&gt;One way to decide whether a component will be a class or functional component is to think of what will go inside the component. If it as a simple component that returns some jsx with props and no logic. This is a Functional component that will only render things to the DOM, others call it a dummy component.&lt;/p&gt;

&lt;p&gt;Class based component are easier to organize&lt;br&gt;
Can use State object to make changes and interactions based on the user inputsThese components also handle and understands lifecycle events. Lifecycles are stages of an application. For example loading screens.&lt;/p&gt;

&lt;p&gt;Rules for Class components&lt;br&gt;
Must be a javascript class &lt;br&gt;
Must externt (subclass) React.Component&lt;br&gt;
Must define a ‘render’ method that returns some jsx&lt;/p&gt;

&lt;h1&gt;
  
  
  justnotes written around this date
&lt;/h1&gt;

</description>
      <category>react</category>
      <category>components</category>
      <category>classes</category>
      <category>functional</category>
    </item>
    <item>
      <title>Propping components</title>
      <dc:creator>Diomedes Lajara</dc:creator>
      <pubDate>Sat, 22 Dec 2018 16:59:27 +0000</pubDate>
      <link>https://forem.com/dlomedes/propping-components-k0o</link>
      <guid>https://forem.com/dlomedes/propping-components-k0o</guid>
      <description>

&lt;p&gt;The most important thing is to pass data from parent component to children components using props. Also to customize how a component interacts/behaves or the looks/style of it.&lt;/p&gt;

&lt;p&gt;The content inside a component’s tags can be called using props.children. This is used to place anything from text to jsx or even another component, which makes it a child component from another file.&lt;/p&gt;

&lt;p&gt;Three parts of a Component &lt;br&gt;
Nesting: comp inside another comp&lt;br&gt;
Create a new component but only import one react library and instead of rendering the component, export it using default followed by the name of the component.&lt;/p&gt;

&lt;p&gt;Reusability: flexibility for multiple uses. few/simple components as possible&lt;br&gt;
Do not forget to import the component at the top of the main index.js file and also calling the component using tags&lt;/p&gt;

&lt;p&gt;Configuration: props is used to configure a component&lt;br&gt;
Use props as the first argument/parameter? Of the component function. Using dot notation to invoke the prop like an object call.&lt;br&gt;
The prop goes after the component name like passing style or className as if it was and HTML/JSX tag. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://thepracticaldev.s3.amazonaws.com/i/spgxnfggv3sh8xlfyrjt.png"&gt;https://thepracticaldev.s3.amazonaws.com/i/spgxnfggv3sh8xlfyrjt.png&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;...justnotes&lt;/p&gt;


</description>
      <category>react</category>
      <category>props</category>
      <category>propschildren</category>
    </item>
    <item>
      <title>HTML and JS had a baby named JSX.</title>
      <dc:creator>Diomedes Lajara</dc:creator>
      <pubDate>Wed, 19 Dec 2018 04:18:23 +0000</pubDate>
      <link>https://forem.com/diomedes/html-and-js-had-a-baby-named-jsx-3a7n</link>
      <guid>https://forem.com/diomedes/html-and-js-had-a-baby-named-jsx-3a7n</guid>
      <description>&lt;p&gt;First I opened up the terminal, ran npm to type "create-react-app jsx"&lt;br&gt;
on the project then proceeded to delete everything inside the SRC folder and created index.js. Added a few comments to guide me using double backslash (//). Inserted React and ReactDOM imports. Followed by creating a Conts App for the newly created Component. Finally threw in a render method with ReactDOM and grabbing the root ID from the index.html using querySelector. &lt;/p&gt;

&lt;p&gt;With this mixture of JSX elements inside the functional component and NPM start in the terminal, I ended up seeing my first component in the screen. “Live with React”&lt;/p&gt;

&lt;p&gt;&lt;a href="https://thepracticaldev.s3.amazonaws.com/i/43hynn9xzinadjhhxyvy.png"&gt;https://thepracticaldev.s3.amazonaws.com/i/43hynn9xzinadjhhxyvy.png&lt;/a&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  postone
&lt;/h1&gt;

</description>
      <category>javascript</category>
      <category>react</category>
      <category>jsx</category>
    </item>
  </channel>
</rss>
