<?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 Pusparasa Ayilavan on Medium]]></title>
        <description><![CDATA[Stories by Pusparasa Ayilavan on Medium]]></description>
        <link>https://medium.com/@ajeelavan1503?source=rss-ebd5f77579c1------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*oRxFi0Bkn4xj6VZGueu_-w.jpeg</url>
            <title>Stories by Pusparasa Ayilavan on Medium</title>
            <link>https://medium.com/@ajeelavan1503?source=rss-ebd5f77579c1------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 05 Dec 2026 23:31:30 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@ajeelavan1503/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[The Ultimate Guide to “useState" in React: Managing State Effectively]]></title>
            <link>https://medium.com/@ajeelavan1503/the-ultimate-guide-to-usestate-in-react-managing-state-effectively-664873778439?source=rss-ebd5f77579c1------2</link>
            <guid isPermaLink="false">https://medium.com/p/664873778439</guid>
            <category><![CDATA[usestate]]></category>
            <category><![CDATA[react]]></category>
            <category><![CDATA[reactive-programming]]></category>
            <dc:creator><![CDATA[Pusparasa Ayilavan]]></dc:creator>
            <pubDate>Fri, 14 Jun 2024 06:21:41 GMT</pubDate>
            <atom:updated>2024-06-14T06:21:41.294Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9mSocn692L7M1FY0Nj7hUw.png" /></figure><p>React has revolutionized the way we build web applications, and one of the most essential hooks in React is useState. In this article, we&#39;ll dive deep into useState, exploring how to use it, common pitfalls, and best practices to manage state effectively in your applications.</p><h3>What is useState?</h3><p>useState is a Hook that lets you add React state to function components. In class components, the state is always an object. With useState, the state doesn’t have to be an object. It can be any type you want, which is one of the reasons why it is so powerful and flexible.</p><h3>Syntax</h3><pre>const [state, setState] = useState(initialState);</pre><ul><li>state: The current state value.</li><li>setState: A function that lets you update the state.</li><li>initialState: The initial state value, can be any type (number, string, object, etc.).</li></ul><h3>How to Use useState</h3><p>Using useState is straightforward. Let&#39;s look at a basic example where we use it to manage a simple counter.</p><pre>import React, { useState } from &#39;react&#39;;<br><br>function Counter() {<br>  // Declare a state variable named &quot;count&quot; with an initial value of 0<br>  const [count, setCount] = useState(0);<br><br>  return (<br>    &lt;div&gt;<br>      &lt;p&gt;You clicked {count} times&lt;/p&gt;<br>      &lt;button onClick={() =&gt; setCount(count + 1)}&gt;<br>        Click me<br>      &lt;/button&gt;<br>    &lt;/div&gt;<br>  );<br>}</pre><h3>Breakdown:</h3><ul><li>We import the useState Hook from React.</li><li>We call useState(0) to initialize the state variable count with a value of 0.</li><li>We use setCount to update the value of count when the button is clicked.</li></ul><h3>Updating State</h3><p>The setState function returned by useState replaces the current state with the new value you provide. It does not merge it with the previous state.</p><pre>const [name, setName] = useState(&quot;John&quot;);<br><br>// This will replace &quot;John&quot; with &quot;Doe&quot;<br>setName(&quot;Doe&quot;);</pre><h3>Important Points:</h3><ul><li>Calling setState does not merge the new state with the old state.</li><li>setState is asynchronous and may not immediately update the state value.</li></ul><h3>Functional Updates</h3><p>Sometimes, you need to update the state based on the previous state value. In such cases, useState provides a functional update form.</p><pre>const [count, setCount] = useState(0);<br><br>const increment = () =&gt; {<br>  setCount(prevCount =&gt; prevCount + 1);<br>};</pre><h3>Why Use Functional Updates?</h3><ul><li>They are more reliable when the state update depends on the previous state.</li><li>They help avoid issues with asynchronous state updates.</li></ul><h3>Working with Objects and Arrays</h3><p>When dealing with objects or arrays, remember that setState does not merge the new state with the old one. You need to manually copy the existing state and then apply your changes.</p><h3>Updating an Object</h3><pre>const [user, setUser] = useState({ name: &quot;John&quot;, age: 30 });<br><br>const updateName = () =&gt; {<br>  setUser(prevUser =&gt; ({ ...prevUser, name: &quot;Doe&quot; }));<br>};</pre><p>Updating an Array</p><pre>const [items, setItems] = useState([1, 2, 3]);<br><br>const addItem = () =&gt; {<br>  setItems(prevItems =&gt; [...prevItems, 4]);<br>};</pre><h3>Common Pitfalls</h3><p><strong>Direct State Mutation</strong>:</p><ul><li>Always return a new state object/array instead of modifying the current one.</li></ul><pre>// Avoid<br>const updateName = () =&gt; {<br>  user.name = &quot;Doe&quot;;<br>  setUser(user);<br>};<br><br>// Correct<br>const updateName = () =&gt; {<br>  setUser(prevUser =&gt; ({ ...prevUser, name: &quot;Doe&quot; }));<br>};</pre><p><strong>State Not Updating Immediately</strong>:</p><ul><li>Remember that setState is asynchronous. Use functional updates if the new state depends on the previous state.</li></ul><p><strong>Initial State from Props</strong>:</p><ul><li>Be cautious when initializing state from props as changes in props will not reflect in the state.</li></ul><h3>Best Practices</h3><p><strong>Keep State Minimal</strong>:</p><ul><li>Only store what’s necessary in the state. Derived data should be computed, not stored.</li></ul><pre>// Instead of storing both first and full name<br>const [firstName, setFirstName] = useState(&quot;John&quot;);<br>const [lastName, setLastName] = useState(&quot;Doe&quot;);<br><br>// Compute the full name dynamically<br>const fullName = `${firstName} ${lastName}`;</pre><p><strong>Use Multiple </strong><strong>useState Hooks for Unrelated State</strong>:</p><ul><li>It’s often cleaner to separate state into multiple state variables if they are unrelated.</li></ul><pre>const [count, setCount] = useState(0);<br>const [name, setName] = useState(&quot;John&quot;);</pre><p><strong>Encapsulate State Logic</strong>:</p><ul><li>Use custom hooks to encapsulate and reuse state logic.</li></ul><p>useState is a powerful and essential hook in React that helps you manage state in functional components. Understanding its nuances and best practices can significantly improve the quality and performance of your applications. Experiment with useState in different scenarios, and you’ll find it indispensable for managing state in your React applications.</p><p>Pusparasa Ayilavan</p><p>Clevonex (Pvt) Ltd</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=664873778439" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Mastering Event Handling in React]]></title>
            <link>https://medium.com/@ajeelavan1503/mastering-event-handling-in-react-b34287d250da?source=rss-ebd5f77579c1------2</link>
            <guid isPermaLink="false">https://medium.com/p/b34287d250da</guid>
            <category><![CDATA[react-event-handling]]></category>
            <category><![CDATA[clonex]]></category>
            <category><![CDATA[webdevelopment-company]]></category>
            <category><![CDATA[clevonex-pvt-ltd]]></category>
            <category><![CDATA[react-events]]></category>
            <dc:creator><![CDATA[Pusparasa Ayilavan]]></dc:creator>
            <pubDate>Mon, 27 May 2024 15:21:48 GMT</pubDate>
            <atom:updated>2024-05-27T15:21:48.096Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*X3QJDoMrQhSmIZbaIdSyuw.png" /></figure><p>React’s declarative approach to building user interfaces makes event handling straightforward and powerful. Whether you’re new to React or looking to brush up on your skills, this guide will walk you through the essentials of handling events in React.</p><h3>Understanding Events in React</h3><p>In React, events are handled using functions passed as props. These functions, known as event handlers, are called when a specific event occurs on a component. React’s event system is very similar to handling events in plain HTML, but with some syntactic differences.</p><h3>Basic Event Handling</h3><p>Let’s start with a simple example: handling a button click event.</p><pre>import React from &#39;react&#39;;<br><br>function ClickButton() {<br>  const handleClick = () =&gt; {<br>    alert(&#39;Button was clicked!&#39;);<br>  };<br><br>  return (<br>    &lt;button onClick={handleClick}&gt;Click Me&lt;/button&gt;<br>  );<br>}<br><br>export default ClickButton;</pre><p>In this example, handleClick is an event handler that is called when the button is clicked. The onClick prop attaches this handler to the button&#39;s click event.</p><h3>Passing Arguments to Event Handlers</h3><p>Sometimes, you need to pass additional data to your event handlers. You can achieve this using arrow functions.</p><pre>import React from &#39;react&#39;;<br><br>function ItemList({ items }) {<br>  const handleItemClick = (item) =&gt; {<br>    alert(`You clicked on ${item}`);<br>  };<br><br>  return (<br>    &lt;ul&gt;<br>      {items.map((item, index) =&gt; (<br>        &lt;li key={index} onClick={() =&gt; handleItemClick(item)}&gt;<br>          {item}<br>        &lt;/li&gt;<br>      ))}<br>    &lt;/ul&gt;<br>  );<br>}<br><br>export default ItemList;</pre><p>Here, each list item has an onClick event handler that passes the item text to handleItemClick when clicked.</p><h3>Using State with Event Handlers</h3><p>Event handlers often need to update the component’s state. React’s useState hook makes this easy.</p><pre>import React, { useState } from &#39;react&#39;;<br><br>function ToggleButton() {<br>  const [isOn, setIsOn] = useState(false);<br><br>  const handleClick = () =&gt; {<br>    setIsOn(!isOn);<br>  };<br><br>  return (<br>    &lt;button onClick={handleClick}&gt;<br>      {isOn ? &#39;ON&#39; : &#39;OFF&#39;}<br>    &lt;/button&gt;<br>  );<br>}<br><br>export default ToggleButton;</pre><p>In this example, clicking the button toggles its text between “ON” and “OFF”. The handleClick function updates the state using setIsOn.</p><h3>Form Handling in React</h3><p>Forms are a common use case for event handling in React. Let’s create a simple form that captures user input.</p><pre>import React, { useState } from &#39;react&#39;;<br><br>function SimpleForm() {<br>  const [inputValue, setInputValue] = useState(&#39;&#39;);<br><br>  const handleInputChange = (event) =&gt; {<br>    setInputValue(event.target.value);<br>  };<br><br>  const handleSubmit = (event) =&gt; {<br>    event.preventDefault();<br>    alert(`Submitted: ${inputValue}`);<br>  };<br><br>  return (<br>    &lt;form onSubmit={handleSubmit}&gt;<br>      &lt;label&gt;<br>        Input:<br>        &lt;input type=&quot;text&quot; value={inputValue} onChange={handleInputChange} /&gt;<br>      &lt;/label&gt;<br>      &lt;button type=&quot;submit&quot;&gt;Submit&lt;/button&gt;<br>    &lt;/form&gt;<br>  );<br>}<br><br>export default SimpleForm;</pre><h3>Explanation:</h3><ol><li>handleInputChange updates the state with the current value of the input field.</li><li>handleSubmit prevents the default form submission behavior and displays an alert with the input value.</li></ol><h3>Event Types in React</h3><p>React supports a wide range of event types, allowing you to handle almost any user interaction. Here are some common event types:</p><h3>Mouse Events</h3><p>Mouse events are triggered by actions such as clicking, double-clicking, and moving the mouse.</p><pre>const handleMouseEnter = () =&gt; {<br>  console.log(&#39;Mouse entered&#39;);<br>};<br><br>const handleMouseLeave = () =&gt; {<br>  console.log(&#39;Mouse left&#39;);<br>};<br><br>return (<br>  &lt;div onMouseEnter={handleMouseEnter} onMouseLeave={handleMouseLeave}&gt;<br>    Hover over me!<br>  &lt;/div&gt;<br>);</pre><h3>Keyboard Events</h3><p>Keyboard events are triggered by user interactions with the keyboard.</p><pre>const handleKeyDown = (event) =&gt; {<br>  console.log(`Key pressed: ${event.key}`);<br>};<br><br>return (<br>  &lt;input type=&quot;text&quot; onKeyDown={handleKeyDown} /&gt;<br>);</pre><h3>Form Events</h3><p>Form events include interactions with form elements like input fields, checkboxes, and buttons.</p><pre>const handleFocus = () =&gt; {<br>  console.log(&#39;Input focused&#39;);<br>};<br><br>const handleBlur = () =&gt; {<br>  console.log(&#39;Input blurred&#39;);<br>};<br><br>return (<br>  &lt;input type=&quot;text&quot; onFocus={handleFocus} onBlur={handleBlur} /&gt;<br>);</pre><h3>Clipboard Events</h3><p>Clipboard events are related to copying, cutting, and pasting content.</p><pre>const handleCopy = () =&gt; {<br>  console.log(&#39;Content copied&#39;);<br>};<br><br>return (<br>  &lt;input type=&quot;text&quot; onCopy={handleCopy} /&gt;<br>);</pre><h3>Touch Events</h3><p>Touch events are used for handling interactions on touch-enabled devices.</p><pre>const handleTouchStart = () =&gt; {<br>  console.log(&#39;Touch started&#39;);<br>};<br><br>const handleTouchEnd = () =&gt; {<br>  console.log(&#39;Touch ended&#39;);<br>};<br><br>return (<br>  &lt;div onTouchStart={handleTouchStart} onTouchEnd={handleTouchEnd}&gt;<br>    Touch me!<br>  &lt;/div&gt;<br>);</pre><h3>Event Pooling in React</h3><p>React’s synthetic events are pooled for performance reasons. This means the event properties are reset after the event callback has been invoked. To access the event asynchronously, you need to call event.persist().</p><pre>import React, { useState } from &#39;react&#39;;<br><br>function DelayedAlert() {<br>  const [inputValue, setInputValue] = useState(&#39;&#39;);<br><br>  const handleChange = (event) =&gt; {<br>    event.persist();<br>    setTimeout(() =&gt; {<br>      alert(event.target.value);<br>    }, 3000);<br>  };<br><br>  return (<br>    &lt;input type=&quot;text&quot; onChange={handleChange} /&gt;<br>  );<br>}<br><br>export default DelayedAlert;</pre><p>In this example, event.persist() ensures the event object is not reused, allowing us to access event.target.value inside the setTimeout callback.</p><h3>Conclusion</h3><p>Event handling is a fundamental part of building interactive applications with React. By mastering event handling, you can create dynamic and responsive user interfaces. In this article, we’ve covered the basics of handling events, passing data to event handlers, using state with event handlers, form handling, different types of events, and understanding event pooling in React.</p><p>React’s approach to event handling is both intuitive and powerful, making it easier to build complex UIs with interactive elements. Keep experimenting with different event handlers and see how they can enhance your React applications!</p><p>next React part loading…</p><p>Pusparasa Ayilavan</p><p>CEO at Clevonex (pvt) Ltd</p><p>info@clevonex.tech</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b34287d250da" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Understanding PropTypes.arrayOf in React: A Practical Guide]]></title>
            <link>https://medium.com/@ajeelavan1503/understanding-proptypes-arrayof-in-react-a-practical-guide-84317c7dc0bf?source=rss-ebd5f77579c1------2</link>
            <guid isPermaLink="false">https://medium.com/p/84317c7dc0bf</guid>
            <category><![CDATA[reactive-programming]]></category>
            <category><![CDATA[code-newbie]]></category>
            <category><![CDATA[prop-types]]></category>
            <category><![CDATA[react-proptypes]]></category>
            <category><![CDATA[array-of-javascript]]></category>
            <dc:creator><![CDATA[Pusparasa Ayilavan]]></dc:creator>
            <pubDate>Sun, 26 May 2024 10:32:47 GMT</pubDate>
            <atom:updated>2024-05-26T10:32:47.231Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xERyOPxHrLaCz8vti537Rg.png" /></figure><p>In React, ensuring that your components receive the right type of props is crucial for maintaining a predictable and bug-free codebase. One powerful feature provided by prop-types is PropTypes.arrayOf, which allows you to specify that a prop should be an array containing items of a certain type. In this article, we&#39;ll explore how to use PropTypes.arrayOf to validate arrays of objects, using a practical example.</p><h4>Why PropTypes?</h4><p>Before diving into arrayOf, it&#39;s essential to understand why we use PropTypes:</p><ul><li>Validation: Ensure your components receive the expected data types.</li><li>Documentation: Provide a clear contract for component usage.</li><li>Debugging: Help catch bugs early by alerting you when props are not as expected.</li></ul><h4>Getting Started</h4><p>First, make sure you have prop-types installed:</p><pre>npm install prop-types</pre><h4>Example Scenario</h4><p>Let’s consider a simple scenario: a UserCard component that displays user profiles. Each profile includes the user&#39;s name, city, description, skills, online status, and profile picture. We&#39;ll use PropTypes.arrayOf to validate that the component receives an array of user objects.</p><h4>Component Structure</h4><p>Here’s the complete code for our User and UserCard components:</p><pre>import React from &#39;react&#39;;<br>import PropTypes from &#39;prop-types&#39;;<br><br>const userData = [<br>  {<br>    name: &quot;Avatar One&quot;,<br>    city: &quot;Colombo&quot;,<br>    description: &quot;Front End Developer&quot;,<br>    skills: [&quot;UI/UX&quot;, &quot;React&quot;, &quot;CSS&quot;, &quot;HTML&quot;],<br>    online: false,<br>    profile: &quot;images/av1.png&quot;,<br>  },<br>  {<br>    name: &quot;Avatar Two&quot;,<br>    city: &quot;Colombo&quot;,<br>    description: &quot;Backend Developer&quot;,<br>    skills: [&quot;Node&quot;, &quot;Express&quot;, &quot;MongoDB&quot;, &quot;SQL&quot;],<br>    online: true,<br>    profile: &quot;images/av2.png&quot;,<br>  },<br>  {<br>    name: &quot;Avatar Three&quot;,<br>    city: &quot;Colombo&quot;,<br>    description: &quot;Full Stack Developer&quot;,<br>    skills: [&quot;UI/UX&quot;, &quot;React&quot;, &quot;Node&quot;, &quot;CSS&quot;, &quot;HTML&quot;],<br>    online: true,<br>    profile: &quot;images/av3.png&quot;,<br>  },<br>];<br><br>const User = ({ name, city, description, skills, online, profile }) =&gt; {<br>  return (<br>    &lt;div className=&quot;card-container&quot;&gt;<br>      &lt;span className={online ? &quot;pro online&quot; : &quot;pro offline&quot;}&gt;<br>        {online ? &quot;ONLINE&quot; : &quot;OFFLINE&quot;}<br>      &lt;/span&gt;<br>      &lt;img src={profile} alt={name} className=&quot;img&quot; /&gt;<br>      &lt;h3&gt;{name}&lt;/h3&gt;<br>      &lt;h3&gt;{city}&lt;/h3&gt;<br>      &lt;p&gt;{description}&lt;/p&gt;<br>      &lt;div className=&quot;buttons&quot;&gt;<br>        &lt;button className=&quot;primary&quot;&gt;Message&lt;/button&gt;<br>        &lt;button className=&quot;primary outline&quot;&gt;Following&lt;/button&gt;<br>      &lt;/div&gt;<br>      &lt;div className=&quot;skills&quot;&gt;<br>        &lt;h6&gt;Skills&lt;/h6&gt;<br>        &lt;ul&gt;<br>          {skills.map((skill, index) =&gt; (<br>            &lt;li key={index}&gt;{skill}&lt;/li&gt;<br>          ))}<br>        &lt;/ul&gt;<br>      &lt;/div&gt;<br>    &lt;/div&gt;<br>  );<br>};<br><br>User.propTypes = {<br>  name: PropTypes.string.isRequired,<br>  city: PropTypes.string.isRequired,<br>  description: PropTypes.string.isRequired,<br>  skills: PropTypes.arrayOf(PropTypes.string).isRequired,<br>  online: PropTypes.bool.isRequired,<br>  profile: PropTypes.string.isRequired,<br>};<br><br>export const UserCard = ({ users }) =&gt; {<br>  return (<br>    &lt;div id=&quot;root&quot;&gt;<br>      {users.map((user, index) =&gt; (<br>        &lt;User<br>          key={index}<br>          name={user.name}<br>          city={user.city}<br>          description={user.description}<br>          skills={user.skills}<br>          online={user.online}<br>          profile={user.profile}<br>        /&gt;<br>      ))}<br>    &lt;/div&gt;<br>  );<br>};<br><br>UserCard.propTypes = {<br>  users: PropTypes.arrayOf(<br>    PropTypes.shape({<br>      name: PropTypes.string.isRequired,<br>      city: PropTypes.string.isRequired,<br>      description: PropTypes.string.isRequired,<br>      skills: PropTypes.arrayOf(PropTypes.string).isRequired,<br>      online: PropTypes.bool.isRequired,<br>      profile: PropTypes.string.isRequired,<br>    })<br>  ).isRequired,<br>};<br><br>// Sample App Component<br>const App = () =&gt; {<br>  return &lt;UserCard users={userData} /&gt;;<br>};<br><br>export default App;</pre><h4>Breaking Down the Code</h4><ol><li>User Component:</li></ol><ul><li>This component represents an individual user card and receives various props to display user details.</li><li>The propTypes property is used to validate that each prop is of the correct type.</li></ul><p>2.UserCard Component:</p><ul><li>This component receives an array of user objects and maps over it to render a User component for each user.</li><li>The propTypes property uses PropTypes.arrayOf combined with PropTypes.shape to validate that users is an array of objects with the specified structure.</li></ul><p>3.App Component:</p><ul><li>This component passes sample user data to the UserCard component.</li></ul><h4>CSS for Styling</h4><p>To style the components, include the following CSS:</p><pre>@import url(https://medium.com/&#39;https://fonts.googleapis.com/css2?family=Inter:wght@100..900&amp;display=swap&#39;);<br><br>* {<br>  box-sizing: border-box;<br>  margin: 0;<br>  padding: 0;<br>}<br><br>body {<br>  font-family: &#39;Inter&#39;, sans-serif;<br>  background-color: #f4f4f4;<br>  display: flex;<br>  justify-content: center;<br>  align-items: center;<br>  min-height: 100vh;<br>}<br><br>#root {<br>  display: flex;<br>  align-items: center;<br>  justify-content: center;<br>  gap: 20px;<br>  flex-wrap: wrap;<br>  width: 100%;<br>  max-width: 1200px;<br>  padding: 20px;<br>}<br><br>h3 {<br>  margin: 10px 0;<br>}<br><br>h6 {<br>  margin: 5px 0;<br>  text-transform: uppercase;<br>}<br><br>p {<br>  font-size: 14px;<br>  line-height: 21px;<br>  text-align: center;<br>}<br><br>.card-container {<br>  background-color: rgb(11, 34, 34);<br>  border-radius: 5px;<br>  box-shadow: 0px 10px 20px -10px rgba(0, 0, 0, 0.75);<br>  color: antiquewhite;<br>  padding: 30px 20px;<br>  width: 350px;<br>  max-width: 100%;<br>  text-align: center;<br>  position: relative;<br>  transition: transform 0.3s ease;<br>}<br><br>.card-container:hover {<br>  transform: translateY(-10px);<br>}<br><br>.pro {<br>  color: aliceblue;<br>  border-radius: 3px;<br>  font-size: 14px;<br>  font-weight: bold;<br>  padding: 3px 7px;<br>  position: absolute;<br>  top: 30px;<br>  left: 30px;<br>}<br><br>.online {<br>  background-color: greenyellow;<br>}<br><br>.offline {<br>  background-color: rgb(108, 100, 100);<br>}<br><br>.img {<br>  border: 3px solid blue;<br>  border-radius: 50%;<br>  padding: 7px;<br>  width: 100px;<br>  height: 100px;<br>  object-fit: cover;<br>}<br><br>.buttons {<br>  display: flex;<br>  justify-content: center;<br>  gap: 10px;<br>  margin-top: 20px;<br>}<br><br>.buttons .primary {<br>  background-color: blue;<br>  border: 1px solid blue;<br>  border-radius: 3px;<br>  color: white;<br>  font-family: &#39;Inter&#39;, sans-serif;<br>  font-weight: 500;<br>  padding: 10px 25px;<br>  cursor: pointer;<br>  transition: background-color 0.3s ease, transform 0.3s ease;<br>}<br><br>.buttons .primary:hover {<br>  background-color: darkblue;<br>}<br><br>.buttons .primary.outline {<br>  background-color: transparent;<br>  color: blue;<br>}<br><br>.buttons .primary.outline:hover {<br>  background-color: blue;<br>  color: white;<br>}<br><br>.skills {<br>  margin-top: 20px;<br>}<br><br>.skills ul {<br>  list-style: none;<br>  padding: 0;<br>}<br><br>.skills li {<br>  background-color: rgba(255, 255, 255, 0.1);<br>  border-radius: 3px;<br>  margin: 5px 0;<br>  padding: 5px;<br>  font-size: 14px;<br>}</pre><h4>Conclusion</h4><p>Using PropTypes.arrayOf in React allows you to enforce that a prop is an array of a certain type, adding robustness and clarity to your component code. By combining arrayOf with shape, you can ensure that each item in the array adheres to a specific structure, making your components more reliable and easier to debug.</p><p>Feel free to experiment with PropTypes in your own projects and enjoy the peace of mind that comes with strong prop validation!</p><p>Next React loading…</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=84317c7dc0bf" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Using the oneOf Prop Type in React]]></title>
            <link>https://medium.com/@ajeelavan1503/using-the-oneof-prop-type-in-react-aa3f032f72ea?source=rss-ebd5f77579c1------2</link>
            <guid isPermaLink="false">https://medium.com/p/aa3f032f72ea</guid>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[react-proptypes]]></category>
            <category><![CDATA[oneof-prop-type]]></category>
            <category><![CDATA[oneof-react]]></category>
            <category><![CDATA[react]]></category>
            <dc:creator><![CDATA[Pusparasa Ayilavan]]></dc:creator>
            <pubDate>Sun, 26 May 2024 07:23:34 GMT</pubDate>
            <atom:updated>2024-05-26T07:23:34.541Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RPmPi0gveIPkffwqS0r0rw.png" /></figure><p><strong>Introduction</strong></p><p>React is a powerful library for building user interfaces, and one of its strengths lies in its robust type-checking abilities. Ensuring that your components receive the correct types of props can save you from a myriad of bugs and make your code more readable and maintainable. In this article, we will delve into the oneOf prop type provided by the PropTypes library in React, demonstrating how to use it effectively to enhance your components.</p><p><strong>What is PropTypes?</strong></p><p>PropTypes is a library that allows you to specify the types of props that your components should receive. This can be particularly useful during development to catch potential bugs early and to document the expected usage of your components.</p><p>To use PropTypes, you need to import it into your component file:</p><pre>import PropTypes from &#39;prop-types&#39;;</pre><p><strong>Understanding </strong><strong>oneOf PropType</strong></p><p>The oneOf prop type is used to ensure that a prop is one of a specific set of values. This is particularly useful for props that should only accept predefined options, such as status indicators, button variants, or any other enumerable options.</p><h3>Basic Example of oneOf</h3><p>Let’s look at a simple example where we use oneOf to validate a status prop in a StatusIndicator component:</p><p><strong>StatusIndicator.jsx</strong></p><pre>import React from &#39;react&#39;;<br>import PropTypes from &#39;prop-types&#39;;<br><br>const StatusIndicator = ({ status }) =&gt; {<br>  const getStatusColor = () =&gt; {<br>    switch (status) {<br>      case &#39;success&#39;:<br>        return &#39;green&#39;;<br>      case &#39;warning&#39;:<br>        return &#39;yellow&#39;;<br>      case &#39;error&#39;:<br>        return &#39;red&#39;;<br>      default:<br>        return &#39;grey&#39;;<br>    }<br>  };<br><br>  return (<br>    &lt;div style={{ color: getStatusColor() }}&gt;<br>      {status}<br>    &lt;/div&gt;<br>  );<br>};<br><br>StatusIndicator.propTypes = {<br>  status: PropTypes.oneOf([&#39;success&#39;, &#39;warning&#39;, &#39;error&#39;]).isRequired,<br>};<br><br>export default StatusIndicator;</pre><p>In this example, the status prop can only be one of &#39;success&#39;, &#39;warning&#39;, or &#39;error&#39;. If any other value is passed, a warning will be shown in the console during development.</p><h3>Advanced Usage with oneOf</h3><p>You can also use oneOf with more complex components and multiple props. For example, let’s create a Button component that accepts a variant prop with predefined styles.</p><p><strong>Button.jsx</strong></p><pre>import React from &#39;react&#39;;<br>import PropTypes from &#39;prop-types&#39;;<br><br>const Button = ({ variant, label, onClick }) =&gt; {<br>  const getButtonStyle = () =&gt; {<br>    switch (variant) {<br>      case &#39;primary&#39;:<br>        return { backgroundColor: &#39;blue&#39;, color: &#39;white&#39; };<br>      case &#39;secondary&#39;:<br>        return { backgroundColor: &#39;grey&#39;, color: &#39;black&#39; };<br>      case &#39;danger&#39;:<br>        return { backgroundColor: &#39;red&#39;, color: &#39;white&#39; };<br>      default:<br>        return {};<br>    }<br>  };<br><br>  return (<br>    &lt;button style={getButtonStyle()} onClick={onClick}&gt;<br>      {label}<br>    &lt;/button&gt;<br>  );<br>};<br><br>Button.propTypes = {<br>  variant: PropTypes.oneOf([&#39;primary&#39;, &#39;secondary&#39;, &#39;danger&#39;]).isRequired,<br>  label: PropTypes.string.isRequired,<br>  onClick: PropTypes.func,<br>};<br><br>Button.defaultProps = {<br>  onClick: () =&gt; {},<br>};<br><br>export default Button;</pre><p>In this example, the variant prop determines the button’s style and must be one of &#39;primary&#39;, &#39;secondary&#39;, or &#39;danger&#39;. This ensures that only valid styles are applied to the button, making the component more predictable and easier to maintain.</p><h3>Why Use oneOf?</h3><p>Using oneOf has several benefits:</p><ol><li>Type Safety: It ensures that your components only receive valid values for certain props, reducing the risk of runtime errors.</li><li>Documentation: It serves as a form of documentation for other developers (or yourself) to understand what values are expected.</li><li>Development Warnings: It provides warnings during development if an invalid value is passed, helping catch bugs early.</li></ol><p><strong>Conclusion</strong></p><p>Using the oneOf prop type in React is a powerful way to enforce prop value restrictions, leading to more robust and maintainable components. By clearly defining the acceptable values for props, you can catch errors early and ensure that your components are used correctly. Incorporate oneOf into your PropTypes arsenal to enhance your React development workflow.</p><p>Next React loading…</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=aa3f032f72ea" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Understanding and Using Props in React]]></title>
            <link>https://medium.com/@ajeelavan1503/understanding-and-using-props-in-react-8f83b2463d43?source=rss-ebd5f77579c1------2</link>
            <guid isPermaLink="false">https://medium.com/p/8f83b2463d43</guid>
            <category><![CDATA[react-props]]></category>
            <category><![CDATA[react-development]]></category>
            <category><![CDATA[props-in-react]]></category>
            <category><![CDATA[componentprops]]></category>
            <category><![CDATA[react-components]]></category>
            <dc:creator><![CDATA[Pusparasa Ayilavan]]></dc:creator>
            <pubDate>Sat, 25 May 2024 14:17:27 GMT</pubDate>
            <atom:updated>2024-05-25T14:17:27.347Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nxMoG2hrh4fQq6iczscapg.png" /></figure><p><strong>Introduction</strong></p><p>React is a popular JavaScript library for building user interfaces, especially single-page applications. One of the core concepts in React is the use of props, short for properties. Props allow you to pass data from one component to another, facilitating communication between components. In this article, we’ll explore what props are, how to use them, and some best practices to keep in mind.</p><p><strong>What are Props?</strong></p><p>Props are read-only attributes used to pass data from a parent component to a child component. They are immutable, meaning they cannot be modified by the child component receiving them. This unidirectional data flow ensures a predictable data management pattern, which is one of the key principles of React.</p><p><strong>Basic Example of Props</strong></p><p>Let’s start with a simple example. We’ll create a parent component that passes props to a child component.</p><p><strong>Parent Component: App.jsx</strong></p><pre>import React from &#39;react&#39;;<br>import { Students } from &#39;./components/Students&#39;;<br>import &#39;./css/App.css&#39;;<br><br>function App() {<br>  return (<br>    &lt;&gt;<br>      &lt;Students name=&quot;Lavan&quot; age={28} isMarried={true} /&gt;<br>      &lt;Students name=&quot;Ayi&quot; age={25} isMarried={false} /&gt;<br>    &lt;/&gt;<br>  );<br>}<br><br>export default App;</pre><p><strong>Child Component: Students.jsx</strong></p><pre>import React from &#39;react&#39;;<br><br>export const Students = (props) =&gt; {<br>  return (<br>    &lt;div className=&quot;student&quot;&gt;<br>      &lt;table&gt;<br>        &lt;tr&gt;<br>          &lt;th&gt;Name&lt;/th&gt;<br>          &lt;td&gt;{props.name}&lt;/td&gt;<br>        &lt;/tr&gt;<br>        &lt;tr&gt;<br>          &lt;th&gt;Age&lt;/th&gt;<br>          &lt;td&gt;{props.age}&lt;/td&gt;<br>        &lt;/tr&gt;<br>        &lt;tr&gt;<br>          &lt;th&gt;Is Married&lt;/th&gt;<br>          &lt;td&gt;{props.isMarried ? &quot;yes&quot; : &quot;no&quot;}&lt;/td&gt;<br>        &lt;/tr&gt;<br>      &lt;/table&gt;<br>    &lt;/div&gt;<br>  );<br>};</pre><p>In this example, the App component is passing the name, age, and isMarried props to the Students component. The Students component receives these props and uses them to render a table with the provided information.</p><p><strong>Destructuring Props</strong></p><p>For cleaner code, you can destructure props directly in the function parameter list.</p><p><strong>Updated Child Component: Students.jsx</strong></p><pre>import React from &#39;react&#39;;<br><br>export const Students = ({ name, age, isMarried }) =&gt; {<br>  return (<br>    &lt;div className=&quot;student&quot;&gt;<br>      &lt;table&gt;<br>        &lt;tr&gt;<br>          &lt;th&gt;Name&lt;/th&gt;<br>          &lt;td&gt;{name}&lt;/td&gt;<br>        &lt;/tr&gt;<br>        &lt;tr&gt;<br>          &lt;th&gt;Age&lt;/th&gt;<br>          &lt;td&gt;{age}&lt;/td&gt;<br>        &lt;/tr&gt;<br>        &lt;tr&gt;<br>          &lt;th&gt;Is Married&lt;/th&gt;<br>          &lt;td&gt;{isMarried ? &quot;yes&quot; : &quot;no&quot;}&lt;/td&gt;<br>        &lt;/tr&gt;<br>      &lt;/table&gt;<br>    &lt;/div&gt;<br>  );<br>};</pre><p><strong>Prop Types</strong></p><p>To ensure the passed props are of the expected type, you can use PropTypes. This is especially useful for catching bugs and improving code readability.</p><p><strong>Adding PropTypes: Students.jsx</strong></p><pre>import React from &#39;react&#39;;<br>import PropTypes from &#39;prop-types&#39;;<br><br>export const Students = ({ name, age, isMarried }) =&gt; {<br>  return (<br>    &lt;div className=&quot;student&quot;&gt;<br>      &lt;table&gt;<br>        &lt;tr&gt;<br>          &lt;th&gt;Name&lt;/th&gt;<br>          &lt;td&gt;{name}&lt;/td&gt;<br>        &lt;/tr&gt;<br>        &lt;tr&gt;<br>          &lt;th&gt;Age&lt;/th&gt;<br>          &lt;td&gt;{age}&lt;/td&gt;<br>        &lt;/tr&gt;<br>        &lt;tr&gt;<br>          &lt;th&gt;Is Married&lt;/th&gt;<br>          &lt;td&gt;{isMarried ? &quot;yes&quot; : &quot;no&quot;}&lt;/td&gt;<br>        &lt;/tr&gt;<br>      &lt;/table&gt;<br>    &lt;/div&gt;<br>  );<br>};<br><br>Students.propTypes = {<br>  name: PropTypes.string.isRequired,<br>  age: PropTypes.number.isRequired,<br>  isMarried: PropTypes.bool.isRequired<br>};</pre><p>Default Props</p><p>You can also define default props for your component. These are used if no prop is provided by the parent component.</p><p><strong>Adding Default Props: Students.jsx</strong></p><pre>import React from &#39;react&#39;;<br>import PropTypes from &#39;prop-types&#39;;<br><br>export const Students = ({ name, age, isMarried }) =&gt; {<br>  return (<br>    &lt;div className=&quot;student&quot;&gt;<br>      &lt;table&gt;<br>        &lt;tr&gt;<br>          &lt;th&gt;Name&lt;/th&gt;<br>          &lt;td&gt;{name}&lt;/td&gt;<br>        &lt;/tr&gt;<br>        &lt;tr&gt;<br>          &lt;th&gt;Age&lt;/th&gt;<br>          &lt;td&gt;{age}&lt;/td&gt;<br>        &lt;/tr&gt;<br>        &lt;tr&gt;<br>          &lt;th&gt;Is Married&lt;/th&gt;<br>          &lt;td&gt;{isMarried ? &quot;yes&quot; : &quot;no&quot;}&lt;/td&gt;<br>        &lt;/tr&gt;<br>      &lt;/table&gt;<br>    &lt;/div&gt;<br>  );<br>};<br><br>Students.propTypes = {<br>  name: PropTypes.string,<br>  age: PropTypes.number,<br>  isMarried: PropTypes.bool<br>};<br><br>Students.defaultProps = {<br>  name: &quot;Unknown&quot;,<br>  age: 0,<br>  isMarried: false<br>};</pre><p><strong>Best Practices for Using Props</strong></p><ol><li>Keep Components Small and Focused: Each component should do one thing well. Use props to pass data and functionality to keep your components reusable and easy to test.</li><li>Use PropTypes and DefaultProps: These help in catching bugs early and ensure your components are used correctly.</li><li>Avoid Unnecessary Props: Only pass the data that your component needs. Excessive props can make your component difficult to understand and maintain.</li><li>Document Your Props: Clearly document what props your component expects. This makes it easier for others (and yourself) to use your components correctly.</li><li>Immutable Data: Since props are read-only, ensure that you do not attempt to modify them within your component. If you need to change data, manage it within the component’s state or use a state management library.</li></ol><p><strong>Conclusion</strong></p><p>Props are a fundamental concept in React that enable components to communicate with each other. By understanding how to use props effectively, you can create more reusable, maintainable, and scalable React applications. Remember to utilize PropTypes and DefaultProps to ensure your components are robust and error-free.</p><p><a href="https://legacy.reactjs.org/docs/components-and-props.html">Get more React Docs</a></p><h4>Pusparasa Ayilavan</h4><h4>Software Engineer, Clevonex (Pvt) Ltd</h4><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8f83b2463d43" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[JavaScript Tutorial | Introduction JS]]></title>
            <link>https://medium.com/@ajeelavan1503/javascript-tutorial-introduction-js-7b5274efe320?source=rss-ebd5f77579c1------2</link>
            <guid isPermaLink="false">https://medium.com/p/7b5274efe320</guid>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[advantages-of-javascript]]></category>
            <category><![CDATA[javascript-tutorial]]></category>
            <category><![CDATA[advantages]]></category>
            <dc:creator><![CDATA[Pusparasa Ayilavan]]></dc:creator>
            <pubDate>Tue, 21 Nov 2023 17:45:23 GMT</pubDate>
            <atom:updated>2023-11-21T17:45:23.804Z</atom:updated>
            <content:encoded><![CDATA[<p>JavaScript is a versatile and widely used programming language that enables you to add interactivity and dynamic behavior to web pages. Originally created to make web pages more interactive, JavaScript is now a key component of modern web development, allowing developers to build complex and powerful web application.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*qHBFuWML2Y5beGm8.png" /><figcaption>JavaScript</figcaption></figure><p><strong><em>Key features and aspects of JavaScript include:</em></strong></p><ol><li><strong>Client-Side Scripting</strong>: JavaScript is primarily used as a client-side scripting language, running in the browser to manipulate the Document Object Model (DOM) of a web page. This enables developers to dynamically update content, respond to user actions, and create a more engaging user experience.</li><li><strong>Syntax</strong>: JavaScript’s syntax is similar to other programming languages like Java and C, making it relatively easy for developers to learn if they are familiar with these languages. It is a high-level, interpreted language, which means that you don’t need to compile your code before running it.</li><li><strong>Variables and Data Types</strong>: JavaScript supports various data types such as numbers, strings, booleans, objects, and arrays. Variables are used to store and manipulate data, and they can be dynamically typed, meaning the type of a variable can change during runtime.</li><li><strong>Functions: </strong>Functions are a fundamental building block in JavaScript. You can define functions to encapsulate reusable pieces of code and execute them when needed. Functions can also take parameters and return values.</li><li><strong>Event Handling:</strong> JavaScript is commonly used to handle events triggered by user actions, such as clicks, key presses, and mouse movements. This allows developers to create interactive and responsive web pages.</li><li><strong>Asynchronous</strong> Programming: JavaScript supports asynchronous programming using mechanisms like callbacks, promises, and async/await. This is crucial for handling tasks that might take some time to complete, such as fetching data from a server without blocking the user interface.</li><li><strong>Object-Oriented Programming (OOP)</strong>: JavaScript is a prototype-based, object-oriented language. Objects play a central role, and you can create and manipulate them to organize and structure your code.</li><li><strong>Libraries and Frameworks:</strong> JavaScript has a rich ecosystem of libraries and frameworks, such as jQuery, React, Angular, and Vue.js, which simplify and streamline the development of complex web applications.</li></ol><h3>Application of JavaScript</h3><p>JavaScript is used to create interactive websites. it’s mainly used for</p><ol><li>Client-side validation</li><li>Dynamic drop-down menus</li><li>Displaying date and time</li><li>Displaying pop-up windows and dialogs boxes</li><li>Displaying clock</li></ol><p>Simple JavaScript Programme</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/912/1*fgB02mZumLiUuq3Ui3c_tw.png" /><figcaption>Click Script</figcaption></figure><h3>External JavaScript Advantages</h3><p>It separates HTML and code</p><p>It make HTML and JavaScript easier to ready and maintain</p><p>Cached JavaScript files can speed up page loads</p><h3>External References</h3><p>With a full URL</p><p>With a file path</p><p>Without any path</p><h3>Disadvantages of External JavaScript</h3><ol><li>The web browser needs to make an additional http request to get the js code.</li><li>We need to check each file that depends on the commonly created external javascript file.</li><li>The stealer may download the coder’s code using the url of the js file.</li><li>If it is a few lines of code, then better to implement the internal javascript code.</li><li>A tiny to a large change in the js code may cause unexpected results in all its dependent files.</li><li>If two js files are dependent on one another, then a failure in one file may affect the execution of the other dependent file.</li></ol><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7b5274efe320" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[PHP Data Types |PHP Operators]]></title>
            <link>https://medium.com/@ajeelavan1503/php-data-types-php-operators-28cd0b33836e?source=rss-ebd5f77579c1------2</link>
            <guid isPermaLink="false">https://medium.com/p/28cd0b33836e</guid>
            <category><![CDATA[php-tutorial]]></category>
            <category><![CDATA[php-data-type]]></category>
            <category><![CDATA[php-operators]]></category>
            <dc:creator><![CDATA[Pusparasa Ayilavan]]></dc:creator>
            <pubDate>Sat, 18 Nov 2023 17:13:51 GMT</pubDate>
            <atom:updated>2023-11-18T17:13:51.512Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*EfVzKl8ilYInv5EB.png" /><figcaption>PHP DATA TYPES</figcaption></figure><h3>PHP Data Types</h3><p>All variable can store data of different types, and different data types can do different things. PHP supports 8 primitive data types that can be categorized further 3 types.</p><p>01.Scalar Types(predefined)</p><p>02.Compound types(user-defined)</p><p>03.Special types</p><h4><strong>Scalar Types</strong></h4><p><strong><em>01.boolean</em></strong></p><p>Booleans are the simplest data type works like swith. It holds only two values. TRUE or FALSE, True is 1 and False is 0. It is often used with conditional statements. if the condition is correct it returns TRUE otherwise FALSE.</p><p><strong><em>02.integer</em></strong></p><p>Integer means numeric data with a negative or positive sign. It holds only whole numbers.</p><p>Rule for Integers:</p><p>an integer can be either positive or negative.</p><p>an integer must not contain decimal point.</p><p>integer can be decimal, octal or hexadecimal</p><p>The range of an integer must be lie between 2,147,483,648 and 2,147,483,647 (-2³¹ to 2³¹).</p><p><strong><em>03.float</em></strong></p><p>A float is number with a decimal point or a number in exponential form. unlike integers.</p><p><strong><em>04.string</em></strong></p><p>A string is a non numeric data type. It holds letters or any alphabets, number and even special characters.</p><p>string values must be enclosed either within single quotes or in double quotes. but both are treated differently.</p><p><strong>Compound Types</strong></p><p><strong><em>05.Array</em></strong></p><p>An array is a compound data type. It can store multiple values data type in single variable.</p><p><strong><em>06.object</em></strong></p><p>Objects are the instances of user defined classes that can store both values and functions.</p><p><strong>Special Types</strong></p><p><strong><em>07.Resource</em></strong></p><p>Resource are not the exact data type in PHP. basically, these are to used to store some function call or references to external PHP resources. For an example A database call. it is an external resource.</p><p><strong><em>08.NULL</em></strong></p><p>NULL is a special data type that has only one value that has only one value. there is a convention of writing it in capital letters as it is case sensitive.</p><h3>PHP Operators</h3><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=28cd0b33836e" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Install PHP|How to Download XAMPP server]]></title>
            <link>https://medium.com/@ajeelavan1503/install-php-how-to-download-xampp-server-ede6380952d2?source=rss-ebd5f77579c1------2</link>
            <guid isPermaLink="false">https://medium.com/p/ede6380952d2</guid>
            <category><![CDATA[how-to-install-xampp]]></category>
            <category><![CDATA[xampp-server]]></category>
            <category><![CDATA[xampp]]></category>
            <category><![CDATA[download-xampp]]></category>
            <dc:creator><![CDATA[Pusparasa Ayilavan]]></dc:creator>
            <pubDate>Sat, 18 Nov 2023 09:42:45 GMT</pubDate>
            <atom:updated>2023-11-18T09:42:45.244Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>Step 1:</strong> Click on the above link provided to download the <strong>XAMPP server</strong> according to your window requirement.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/932/1*4krWa8A7xR0RRIsXYAgLxg.png" /></figure><p><strong>Step 2:</strong> After downloading XAMPP, double click on the downloaded file and allow XAMPP to make changes in your system. A window will pop-up, where you have to click on the <strong>Next</strong> button.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/516/0*wyHQCxFQu14WlNuP.png" /></figure><p><strong>Step 3:</strong> Here, select the components, which you want to install and click <strong>Next</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/516/0*sf4qvOr34SjrMcMZ.png" /></figure><p><strong>Step 4:</strong> Choose a folder where you want to install the XAMPP in your system and click <strong>Next</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/516/0*5iQobTeVoVM742z6.png" /></figure><p><strong>Step 5:</strong> Click <strong>Next</strong> and move ahead.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/516/0*QsneJCwchZzpA52I.png" /></figure><p><strong>Step 6:</strong> XAMPP is ready to install, so click on the <strong>Next</strong> button and install the XAMPP.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/516/0*62T4N4HE-8gGRtmQ.png" /></figure><p><strong>Step 7:</strong> A finish window will display after successful installation. Click on the <strong>Finish</strong> button.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/516/0*m3clVxBpEyfcGDaN.png" /></figure><p><strong>Step 8:</strong> Choose your preferred language.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/619/1*mXYMsNndQg-1j2kDqGPvLg.png" /></figure><p><strong>Step 9:</strong> XAMPP is ready to use. Start the Apache server and MySQL and run the php program on the localhost.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/825/1*phiU3lyoVFPXDuf0b3A1Ug.png" /></figure><p><strong>Step 10:</strong> If no error is shown, then XAMPP is running successfully.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/823/1*MXJ09s05ykYPu2ojN5glbQ.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ede6380952d2" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[PHP Features and Development]]></title>
            <link>https://medium.com/@ajeelavan1503/php-features-and-development-a9819be0c835?source=rss-ebd5f77579c1------2</link>
            <guid isPermaLink="false">https://medium.com/p/a9819be0c835</guid>
            <category><![CDATA[php-features]]></category>
            <category><![CDATA[php-variable]]></category>
            <category><![CDATA[php]]></category>
            <dc:creator><![CDATA[Pusparasa Ayilavan]]></dc:creator>
            <pubDate>Sat, 18 Nov 2023 01:33:04 GMT</pubDate>
            <atom:updated>2023-11-18T08:37:08.711Z</atom:updated>
            <content:encoded><![CDATA[<h3>Developers Life Cycle Part-02</h3><p>PHP s a server side scripting language, which is used to design the dynamic web application with MySql database.</p><p>We can create sessions in PHP.</p><p>It can access cookies variable and also set cookies.</p><p>It handles dynamic, database as well as session tracking foe website.</p><p>It help to encrypt the data and apply validation.</p><p>Using PHP language you can control the user to access some pages of your website.</p><p>PHP supports several protocols such as HTTP,POP3,SNMP, LDAP,IMAP and many more.</p><p>As PHP is easy to install and set up this is the main reson why PHP is the best language to learn.</p><p><strong>Features-PHP</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*IRUTBc789Oqrs9LN.png" /><figcaption>Features of PHP</figcaption></figure><p>PHP is very popular language because of its simplicity and open source. there are some important features og given below</p><p><strong>Performance:</strong></p><p>PHP script is executed much faster than those scripts which are written in other languages such as JSP and ASP. PHP uses its own memory, so the server workload and loading time is automatically reduced which results in faster processing speed and better performance.</p><p><strong>Embedded:</strong></p><p>PHP code can be easily embedded within HTML tags and script.</p><p><strong>Platform Independent:</strong></p><p>PHP is available for Windows ,Mac and Linux oprating system. A PHP application developed in one OS can be easily executed in other OS also.</p><p><strong>Open Source:</strong></p><p>PHP source code and software are freely violable on the web. We can develop all the versions of PHP according to Your requirement without paying any cost. all its components are free to download.</p><p><strong>Familiarity with syntax:</strong></p><p>PHP has easily understandable syntax. Programmers are comfortable coding with it. PHP supports all the leading database such as MySQL, SQLite and many more.</p><p><strong>Security:</strong></p><p>PHP is a secure language to develop the website. It consists of multiple layers of security to prevent threads and malicious attacks.</p><p><strong>Web servers supports:</strong></p><p>PHP is compatible with almost local servers used today like Apache, Netscape, Microsoft IIS.</p><h3><strong>PHP Web Development</strong></h3><p>PHP is widely used in web development nowadays. PHP can develop dynamic website easily. but we must have the basic the knowledge of following technologies for web development as well.</p><p>HTML ,CSS, JavaScript, Ajax, XML and Json, JQuery.</p><p><strong>PHP comments</strong></p><p>Comment only purpose is to be ready by someone who is looking at the code. comment can be used to Others understand our code.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*uoMKBrThmy15EN0pzSP1uA.png" /><figcaption>PHP Comments</figcaption></figure><p><strong>PHP Variables</strong></p><p>variable starts with the $ sign, followed by the name of the variable.</p><p>A variable can have a short name or a more descriptive name.</p><p><strong>Rule for PHP variables:</strong></p><p>A variable name Can’t start with a numbers.</p><p>A variable start with the $ sign, followed by the name of the variable</p><p>A variable name must start a letter or the underscore character.</p><p>Variable names are case-sensitive</p><p>OutPut Variables- echo</p><h4>Variables scope</h4><p>php has three different variable scopes. local, global and static.</p><p>A variable declared outside a function has a global scope and can only accessed outside function.</p><p><strong>PHP echo &amp; print Statements</strong></p><p>echo and print are more or less the same. they are both used to output data to the screen.</p><p>basic difference are small echo has no return value while print has a return value of 1 so it can used in expression. echo can take multiple parameters while print can take one argument. echo is marginally faster than print.</p><p>the echo ,print statement can be used with or without parentheses: echo or echo().</p><h4><strong>The PHP echo statement</strong></h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mS4f7b2f_7v1kVqmBH6oQg.png" /><figcaption>Echo</figcaption></figure><h4>The PHP print Statement</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/923/1*madnmdck1rTaqTzWdjxUOw.png" /><figcaption>Print</figcaption></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a9819be0c835" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[PHP]]></title>
            <link>https://medium.com/@ajeelavan1503/php-d0a975014e58?source=rss-ebd5f77579c1------2</link>
            <guid isPermaLink="false">https://medium.com/p/d0a975014e58</guid>
            <category><![CDATA[php-development]]></category>
            <category><![CDATA[php-8]]></category>
            <category><![CDATA[php-basic]]></category>
            <category><![CDATA[php]]></category>
            <category><![CDATA[php-developers]]></category>
            <dc:creator><![CDATA[Pusparasa Ayilavan]]></dc:creator>
            <pubDate>Fri, 17 Nov 2023 18:29:49 GMT</pubDate>
            <atom:updated>2023-11-17T18:29:49.057Z</atom:updated>
            <content:encoded><![CDATA[<h3>Developers Life Cycle Part-01</h3><p>covers all the topics of PHP such as</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/512/0*bYildm-_FxN2dsBp.png" /><figcaption><strong>PHP</strong></figcaption></figure><p><strong>01.Introduction</strong></p><p>02.Control Statement</p><p>03.PHP Programs</p><p>04.PHP Functions</p><p>05.PHP Arrays</p><p>06.PHP Strings</p><p>07.PHP Math</p><p>08.PHP Form</p><p>09.PHP Include</p><p>10.State Management</p><p>11.PHP File</p><p>12.Upload Download</p><p>13.PHP Misc</p><p>14.PHP Mail</p><p>15.PHP MySQLi</p><p>16.PHP JSON</p><p>17.PHP OOPs Concepts</p><p>18.PHP Topics</p><p>19.PHP Advanced</p><p>20.PHP XML</p><p>21.PHP — AJAX</p><p>22.PHP Examples</p><p><strong>Now We are looking for PHP- Introduction</strong></p><p>PHP is an open-source ,Object oriented scripting language that can be executed at the server-side. PHP is the one of the best Language in the world. therefore it is used to develop web application. This is generating dynamic page. PHP was created by Rasmus Lerdorf in 1994 but interduced in the market 1995. PHP 8.2 is the latest version of PHP(2023), which was released on November 24, 2022.</p><p>Important points-PHP</p><p>PHP Stands for Hypertext Preprocessor.</p><p>PHP is an Interpreted language.</p><p>PHP is faster than other scripting language.</p><p>PHP is a server side scripting language.</p><p>PHP can be embedded into HTML.</p><p>PHP is an object oriented language.</p><p>PHP is an open source scripting language</p><p>PHP is simple and easy to learn language.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/912/1*fkXi9uFYjIsfFqGjoyhq8w.png" /><figcaption>Basic PHP Syntax Code</figcaption></figure><p><strong>PHP is an amazing and popular language.</strong></p><p>It is powerful enough to be at the core of the biggest blogging system on the web. It is deep enough to run large social networks. this is also easy enough to be a beginner’s first server side language.</p><p><strong>What can…</strong></p><p>Encrypt data</p><p>Be used to control user-access</p><p>collect from data</p><p>create, open, read, write, delete and close files on server</p><p><strong>Why…</strong></p><p>Supports a wide range of databases</p><p>easy to learn and runs efficiently on the server side</p><p>Run on various platform [ex: Windows, Linux, Mac]</p><p>Next!!!</p><p><strong>Developers Life Cycle Part-02……</strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d0a975014e58" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>