<?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 Nitish_Negi on Medium]]></title>
        <description><![CDATA[Stories by Nitish_Negi on Medium]]></description>
        <link>https://medium.com/@nitishnegi79?source=rss-ca39a6dfbb43------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*Dmme8tAV9h4usTYP</url>
            <title>Stories by Nitish_Negi on Medium</title>
            <link>https://medium.com/@nitishnegi79?source=rss-ca39a6dfbb43------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 28 Nov 2026 20:50:29 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@nitishnegi79/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[Integrate GooglePay in React]]></title>
            <link>https://medium.com/@nitishnegi79/integrate-googlepay-in-react-52abf4255d76?source=rss-ca39a6dfbb43------2</link>
            <guid isPermaLink="false">https://medium.com/p/52abf4255d76</guid>
            <dc:creator><![CDATA[Nitish_Negi]]></dc:creator>
            <pubDate>Thu, 09 Oct 2025 04:52:53 GMT</pubDate>
            <atom:updated>2025-10-09T04:52:53.588Z</atom:updated>
            <content:encoded><![CDATA[<p>When processing payments, you often use a checkout form where customers input their shipping and payment information. However, this process can be a hassle for your customers. They may not remember the 16-digit card number, the security code, or the card’s expiration date. They might also be sceptical about the security of the website, even if it has an SSL certificate and a secure lock icon in the address bar. Additionally, customers must repeatedly enter the same information across various online shopping platforms.</p><p>These obstacles can create friction in the checkout process and potentially reduce sales. To provide a smoother and simpler checkout experience, the Google Pay API can give you easy access to your customers’ stored payment details saved in their Google accounts. By using the Google Pay API, your customers won’t have to manually enter their card information at checkout, streamlining the purchasing process.</p><h3>Load the Google Pay API JavaScript Library</h3><p>First, add the script tag to your application’s index.html file to load the Google Pay JavaScript library.</p><pre>&lt;script<br>  async<br>  src=&quot;https://pay.google.com/gp/p/js/pay.js&quot;<br>  onload​=&quot;onGooglePayLoaded()&quot;&gt;<br>&lt;/script&gt;</pre><h3>Initialize Google Pay API</h3><p>As soon as the script is loaded, construct the Payments Client object. Begin by instantiating the client object globally in the window object, which you will use to make calls to the Google Pay API from your component later on.</p><pre>function onGooglePayLoaded() {<br>  window.googlePayClient = new google.payments.api.PaymentsClient({<br>    environment: &quot;TEST&quot;<br>  });<br>}</pre><p>The payment client is initialized with a Payment Options object. For the TEST environment, you don’t need to register with Google. In the TEST environment, Google will give access to real card details, but you won’t be able to charge them. To enable actual payments, you need to register with Google for PRODUCTION access.</p><h3>Configure the Payment Methods</h3><p>In the App.js file, define the card networks and the authentication methods that will be allowed by your application</p><pre>const { googlePayClient } = window;</pre><pre>const baseCardPaymentMethod = {<br>  type: &quot;CARD&quot;,<br>  parameters: {<br>    allowedCardNetworks: [&quot;VISA&quot;, &quot;MASTERCARD&quot;],<br>    allowedAuthMethods: [&quot;PAN_ONLY&quot;, &quot;CRYPTOGRAM_3DS&quot;]<br>  }<br>};</pre><h3>Define the API Version</h3><p>After you have configured the payment methods, define the Google Pay API version that will be used to process the payment, along with the allowed Payment Methods property to which you need to pass the baseCardPaymentMethod object.</p><pre>const googlePayBaseConfiguration = {<br>  apiVersion: 2,<br>  apiVersionMinor: 0,<br>  allowedPaymentMethods: [baseCardPaymentMethod]<br>};</pre><h3>Determine Readiness to Pay With Google Pay</h3><p>Now that the payment client is configured and defined, check whether Google Pay API is ready to make payments. This also includes checking whether the API is supported for the current device and browser.</p><p>Check the readiness as soon as the component is mounted. If it is a class component, use the componentDidMount() lifecycle method, and if it is a functional component, use the useEffect hook.</p><pre>function App() {<br>  // ...<br>  useEffect(() =&gt; {<br>    googlePayClient<br>      .isReadyToPay(googlePayBaseConfiguration)<br>      .then(res =&gt; {<br>        if (res.result) {<br>          createAndRenderPayButton();<br>        } else {<br>          alert(&quot;Unable to pay using Google Pay&quot;);<br>        }<br>      })<br>      .catch(function (err) {<br>        console.error(&quot;Error determining readiness to use Google Pay: &quot;, err);<br>      });<br>  }, []);<br>}</pre><p>The isReadyToPay() method takes in the base configuration as its argument and determine readiness to pay. As it is asynchronous in nature, you need to attach the .then() and .catch() calls to it. If there’s a successful response, render the Google Pay Button to the user. Otherwise, show alternative payment methods as a fallback.</p><h3>Add the Pay With GPay Button</h3><p>Now, when you know that the user is ready to make a payment, call the second API, <strong>createButton</strong>(). The <strong>createButton</strong>() method will return the Pay with GPay button HTML element. You can pass options like buttonColor and <strong>buttonType</strong> to style the button so that it blends in well with your overall site colors.</p><p>Set the button HTML in your component’s state so that it can be rendered by JSX using the <em>dangerouslySetInnerHTML</em> prop.</p><pre>const [gPayBtn, setGPayBtn] = useState(null);</pre><pre>function createAndAddButton() {<br>  if (googlePayClient) {<br>    const googlePayButton = googlePayClient.createButton({<br>      buttonColor: &quot;default&quot;,</pre><pre>      buttonType: &quot;long&quot;,</pre><pre>      onClick: processPayment<br>    });</pre><pre>    setGPayBtn(googlePayButton);<br>  }<br>}</pre><pre>return (<br>  &lt;div className=&quot;App&quot;&gt;<br>    &lt;h1&gt;Click the Pay button&lt;/h1&gt;<br>    &lt;div<br>      onClick​={processPayment}<br>      dangerouslySetInnerHTML={{ __html: gPayBtn &amp;&amp; gPayBtn.innerHTML }}<br>    /&gt;<br>  &lt;/div&gt;<br>);</pre><p>When the button is clicked, call processPayment(), which will start the payment process.</p><h3>Payment</h3><p>Once you add the button to your page and the user clicks on the Google Pay Button, call the loadPaymentData() method to open up the Google Pay payment window. Construct the paymentDataRequest object, which includes a set of payment configurations which will be used for this particular transaction.</p><pre>function processPayment() {<br>  // ...<br>  googlePayClient<br>    .loadPaymentData(paymentDataRequest)<br>    .then(function (paymentData) {<br>      console.log(paymentData);<br>    })<br>    .catch(function (err) {<br>      console.log(err);<br>    });<br>}</pre><p>In addition to the payment credentials, you can also request additional information such as email, phone number, shipping address, billing address, etc.</p><pre>const cardPaymentMethod = {<br>  type: &quot;CARD&quot;,<br>  tokenizationSpecification: tokenizationSpecification,<br>  parameters: {<br>    allowedCardNetworks: [&quot;VISA&quot;, &quot;MASTERCARD&quot;],<br>    allowedAuthMethods: [&quot;PAN_ONLY&quot;, &quot;CRYPTOGRAM_3DS&quot;],<br>    billingAddressRequired: true,<br>    billingAddressParameters: {<br>      format: &quot;FULL&quot;,<br>      phoneNumberRequired: true<br>    }<br>  }<br>}</pre><p>The transaction and merchant information, along with the base configuration object, should be included in the paymentDataRequest object.</p><pre>const transactionInfo = {<br>  totalPriceStatus: &quot;FINAL&quot;,<br>  totalPrice: &quot;123.45&quot;,<br>  currencyCode: &quot;USD&quot;<br>};</pre><pre>const merchantInfo = {<br>  // merchantId: &#39;01234567890123456789&#39;, Only in PRODUCTION<br>  merchantName: &quot;Your Merchant Name&quot;<br>};</pre><pre>const paymentDataRequest = {<br>  ...googlePayBaseConfiguration,<br>  ...{<br>    allowedPaymentMethods: [cardPaymentMethod],<br>    transactionInfo,<br>    merchantInfo<br>   }<br>}</pre><p>tokenizationSpecification is an object which contains the payment request tokenization parameters. Here, you define which payment gateway you’ll be using in your application.</p><pre>const tokenizationSpecification = {<br>  type: &quot;PAYMENT_GATEWAY&quot;,<br>  parameters: {<br>    gateway: &quot;example&quot;,<br>    gatewayMerchantId: &quot;gatewayMerchantId&quot;<br>  }<br>};</pre><p>The tokenization specification defines how the payment method chosen by your customers is managed and used to complete a transaction. When you’ve constructed the request object, pass it to loadPaymentData, an async call which will open a Google payment sheet. After the user makes a selection, Google will return you a paymentData object, which consists of metadata about the user’s selection. It includes the payment token, which you can use to complete the transaction. At this point, you have carried out all of the required steps, and your transaction is ready to be completed.</p><h3>Complete Source Code</h3><pre>import React, { useState, useEffect } from &quot;react&quot;;<br>import &quot;./styles.css&quot;;</pre><pre>const { googlePayClient } = window;</pre><pre>const baseCardPaymentMethod = {<br>  type: &quot;CARD&quot;,<br>  parameters: {<br>    allowedCardNetworks: [&quot;VISA&quot;, &quot;MASTERCARD&quot;],<br>    allowedAuthMethods: [&quot;PAN_ONLY&quot;, &quot;CRYPTOGRAM_3DS&quot;]<br>  }<br>};</pre><pre>const googlePayBaseConfiguration = {<br>  apiVersion: 2,<br>  apiVersionMinor: 0,<br>  allowedPaymentMethods: [baseCardPaymentMethod]<br>};</pre><pre>export default function App() {<br>  const [gPayBtn, setGPayBtn] = useState(null);</pre><pre>  function createAndAddButton() {<br>    if (googlePayClient) {<br>      const googlePayButton = googlePayClient.createButton({<br>        buttonColor: &quot;default&quot;,</pre><pre>        buttonType: &quot;long&quot;,</pre><pre>        onClick: processPayment<br>      });</pre><pre>      setGPayBtn(googlePayButton);<br>    }<br>  }</pre><pre>  function processPayment() {<br>    console.log(&quot;test&quot;);<br>    const tokenizationSpecification = {<br>      type: &quot;PAYMENT_GATEWAY&quot;,<br>      parameters: {<br>        gateway: &quot;Cybersource&quot;,<br>        &quot;stripe:version&quot;: &quot;stub_data&quot;,<br>        &quot;stripe:publishableKey&quot;: &quot;stub_data&quot;<br>      }<br>    };</pre><pre>    const cardPaymentMethod = {<br>      type: &quot;CARD&quot;,<br>      tokenizationSpecification: tokenizationSpecification,<br>      parameters: {<br>        allowedCardNetworks: [&quot;VISA&quot;, &quot;MASTERCARD&quot;],<br>        allowedAuthMethods: [&quot;PAN_ONLY&quot;, &quot;CRYPTOGRAM_3DS&quot;],<br>        billingAddressRequired: true,<br>        billingAddressParameters: {<br>          format: &quot;FULL&quot;,<br>          phoneNumberRequired: true<br>        }<br>      }<br>    };</pre><pre>    const transactionInfo = {<br>      totalPriceStatus: &quot;FINAL&quot;,<br>      totalPrice: &quot;123.45&quot;,<br>      currencyCode: &quot;USD&quot;<br>    };</pre><pre>    const merchantInfo = {<br>      // merchantId: &#39;01234567890123456789&#39;, Only in PRODUCTION<br>      merchantName: &quot;Example Merchant Name&quot;<br>    };</pre><pre>    const paymentDataRequest = {<br>      ...googlePayBaseConfiguration,<br>      ...{<br>        allowedPaymentMethods: [cardPaymentMethod],<br>        transactionInfo,<br>        merchantInfo<br>      }<br>    };</pre><pre>    googlePayClient<br>      .loadPaymentData(paymentDataRequest)<br>      .then(function (paymentData) {<br>        console.log(paymentData);<br>      })<br>      .catch(function (err) {<br>        console.log(err);<br>      });<br>  }</pre><pre>  useEffect(() =&gt; {<br>    googlePayClient<br>      .isReadyToPay(googlePayBaseConfiguration)<br>      .then(function (response) {<br>        if (response.result) {<br>          createAndAddButton();<br>        } else {<br>          alert(&quot;Unable to pay using Google Pay&quot;);<br>        }<br>      })<br>      .catch(function (err) {<br>        console.error(&quot;Error determining readiness to use Google Pay: &quot;, err);<br>      });<br>  }, []);</pre><pre>  return (<br>    &lt;div className=&quot;App&quot;&gt;<br>      &lt;h1&gt;Click the Pay button&lt;/h1&gt;<br>      &lt;div<br>        onClick​={processPayment}<br>        dangerouslySetInnerHTML={{ __html: gPayBtn &amp;&amp; gPayBtn.innerHTML }}<br>      /&gt;<br>    &lt;/div&gt;<br>  );<br>}</pre><h3>Conclusion</h3><p>Given the fact that the checkout process can be one of the worst experiences a user faces, you should consider integrating Google Pay with all your e-commerce applications.</p><p>Remember, Google Pay API won’t process the payment; it will be done by a payment processor like Cybersource, Stripe or Paypal.</p><p>Google Pay plays a vital role in facilitating the exchange of sensitive information between the user and the payment processor.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=52abf4255d76" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Building Agentic AI with LangGraph: A Deep Dive into Tools, Agents, and Code]]></title>
            <link>https://medium.com/@nitishnegi79/building-agentic-ai-with-langgraph-a-deep-dive-into-tools-agents-and-code-4b922f972ea0?source=rss-ca39a6dfbb43------2</link>
            <guid isPermaLink="false">https://medium.com/p/4b922f972ea0</guid>
            <dc:creator><![CDATA[Nitish_Negi]]></dc:creator>
            <pubDate>Thu, 24 Jul 2025 17:47:37 GMT</pubDate>
            <atom:updated>2025-07-24T17:47:37.004Z</atom:updated>
            <content:encoded><![CDATA[<h3>As the world shifts toward more <strong>autonomous AI systems</strong>, frameworks like LangGraph are emerging as powerful solutions for orchestrating complex, <strong>agent-based workflows</strong>.</h3><p>In this post, we’ll explore how to:</p><ul><li>Design <strong>agentic systems</strong> using LangGraph</li><li>Equip them with <strong>tools</strong></li><li>Use <strong>LangChain agents</strong> inside LangGraph</li><li>And, of course, walk through working <strong>code</strong></li></ul><p><strong>Why Agentic AI?</strong></p><p>Traditional AI models follow a linear prompt-response paradigm. But sometimes, we need them to <strong>reason, reflect, and interact with tools</strong> — or even other agents — to complete complex tasks. That’s where agentic AI comes in.</p><p>LangGraph provides a graph-based programming model built on top of <strong>LangChain</strong>, enabling:</p><ul><li><strong>Stateful execution</strong></li><li><strong>Multi-agent collaboration</strong></li><li>Built-in support for <strong>tools</strong>, memory, retries, and more</li></ul><p><strong>Architecture Overview</strong></p><p>Let’s say we want to build a simple <strong>research assistant</strong> with:</p><ul><li>A <strong>Planner Agent</strong> to decide what to do</li><li>A <strong>Research Agent</strong> to search the web</li><li>A <strong>Summarizer Agent</strong> to condense findings</li><li>Access to tools like <strong>BingSearchAPI</strong> or <strong>Wikipedia</strong></li></ul><p>This would look like a <strong>graph</strong> where nodes are agents and tools, and edges define how outputs move across the system.</p><p><strong>Step 1: Setup</strong></p><p>Install dependencies</p><pre>pip install langgraph langchain openai</pre><p>Optional: Search tool support</p><pre>pip install langchainhub langchain-community</pre><p><strong>Step 2: Define Tools</strong></p><pre>from langchain.tools import Tool<br>from langchain_community.tools import DuckDuckGoSearchRun</pre><pre>search_tool = Tool(<br>    name=&quot;search_web&quot;,<br>    func=DuckDuckGoSearchRun().run,<br>    description=&quot;Use this to search the web for current information&quot;<br>)</pre><p><strong>Step 3: Define Agents</strong></p><pre>from langchain.agents import initialize_agent, AgentType<br>from langchain.chat_models import ChatOpenAI</pre><pre>llm = ChatOpenAI(temperature=0)</pre><pre># Research agent<br>research_agent = initialize_agent(<br>    tools=[search_tool],<br>    llm=llm,<br>    agent=AgentType.ZERO_SHOT_REACT_DESCRIPTION,<br>    verbose=True<br>)</pre><pre># Summarizer<br>def summarize_text(text):<br>    return llm.predict(f&quot;Summarize the following:\n\n{text}&quot;)</pre><p><strong>Step 4: Build the LangGraph</strong></p><pre>from langgraph.graph import StateGraph, END</pre><pre># Shared state format<br>class AgentState(dict):<br>    pass</pre><pre># Define node functions<br>def planner_node(state):<br>    query = state[&quot;input&quot;]<br>    return {&quot;task&quot;: f&quot;Find recent news about: {query}&quot;}</pre><pre>def research_node(state):<br>    result = research_agent.run(state[&quot;task&quot;])<br>    return {&quot;research_result&quot;: result}</pre><pre>def summarizer_node(state):<br>    summary = summarize_text(state[&quot;research_result&quot;])<br>    return {&quot;summary&quot;: summary}</pre><pre># Construct the graph<br>graph = StateGraph(AgentState)</pre><pre>graph.add_node(&quot;planner&quot;, planner_node)<br>graph.add_node(&quot;researcher&quot;, research_node)<br>graph.add_node(&quot;summarizer&quot;, summarizer_node)</pre><pre># Add edges<br>graph.set_entry_point(&quot;planner&quot;)<br>graph.add_edge(&quot;planner&quot;, &quot;researcher&quot;)<br>graph.add_edge(&quot;researcher&quot;, &quot;summarizer&quot;)<br>graph.add_edge(&quot;summarizer&quot;, END)</pre><pre># Compile<br>app = graph.compile()</pre><p><strong>Step 5: Run the Graph</strong></p><pre>response = app.invoke({&quot;input&quot;: &quot;AI breakthroughs in 2025&quot;})<br>print(response[&quot;summary&quot;])</pre><p><strong>Output Example</strong></p><pre>AI breakthroughs in 2025 include advancements in multimodal models, more robust</pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4b922f972ea0" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to Lift State Up in React Applications]]></title>
            <link>https://medium.com/@nitishnegi79/how-to-lift-state-up-in-react-applications-9c632d612f15?source=rss-ca39a6dfbb43------2</link>
            <guid isPermaLink="false">https://medium.com/p/9c632d612f15</guid>
            <dc:creator><![CDATA[Nitish_Negi]]></dc:creator>
            <pubDate>Fri, 25 Apr 2025 08:12:39 GMT</pubDate>
            <atom:updated>2025-04-25T08:19:09.139Z</atom:updated>
            <content:encoded><![CDATA[<p>When building React applications, one of the common challenges developers face is managing and sharing state between components. One powerful technique to handle this is <strong>“Lifting State Up”</strong>. If you’ve ever had sibling components that needed to share data or sync behavior, you’ve probably run into a situation where lifting state is the best solution.</p><p>In this article, we’ll break down what it means, when to use it, and how to implement it effectively — with real code examples.</p><h3>What Does “Lifting State Up” Mean?</h3><p>In React, <strong>“lifting state up”</strong> refers to moving state from a child component to a <strong>common parent component</strong>, so that the state can be shared across multiple components.</p><p>React promotes <strong>unidirectional data flow</strong> — from parent to child via props. If two sibling components need access to the same piece of state, that state should live in their <strong>nearest common ancestor</strong>.</p><h3>When Should You Lift State Up?</h3><p>You should lift state up when:</p><ul><li>Two or more components need access to the same data</li><li>A child needs to communicate changes back to a parent or another child</li><li>You’re dealing with <strong>shared forms</strong>, <strong>filters</strong>, <strong>modals</strong>, or <strong>toggles</strong> that affect multiple parts of the UI</li></ul><h3>Example: Lifting State Up in Action</h3><p>Let’s look at a simple example: a <strong>temperature converter</strong> with two inputs — one in Celsius, and one in Fahrenheit. We want the inputs to update each other as you type.</p><h3>1. App.js</h3><pre>import React, { useState } from &#39;react&#39;;<br>import TemperatureInput from &#39;./components/TemperatureInput&#39;;</pre><pre>function App() {<br>  const [temperature, setTemperature] = useState(&#39;&#39;);<br>  const [scale, setScale] = useState(&#39;c&#39;);</pre><pre>  const handleCelsiusChange = (temp) =&gt; {<br>    setTemperature(temp);<br>    setScale(&#39;c&#39;);<br>  };</pre><pre>  const handleFahrenheitChange = (temp) =&gt; {<br>    setTemperature(temp);<br>    setScale(&#39;f&#39;);<br>  };</pre><pre>  const toCelsius = (f) =&gt; ((f - 32) * 5) / 9;<br>  const toFahrenheit = (c) =&gt; (c * 9) / 5 + 32;</pre><pre>  const tryConvert = (temp, convert) =&gt; {<br>    const input = parseFloat(temp);<br>    if (Number.isNaN(input)) return &#39;&#39;;<br>    const output = convert(input);<br>    return Math.round(output * 1000) / 1000;<br>  };</pre><pre>  const celsius = scale === &#39;f&#39; ? tryConvert(temperature, toCelsius) : temperature;<br>  const fahrenheit = scale === &#39;c&#39; ? tryConvert(temperature, toFahrenheit) : temperature;</pre><pre>  return (<br>    &lt;div className=&quot;container&quot;&gt;<br>      &lt;h1&gt;Temperature Converter&lt;/h1&gt;<br>      &lt;TemperatureInput<br>        scale=&quot;c&quot;<br>        temperature={celsius}<br>        onTemperatureChange={handleCelsiusChange}<br>      /&gt;<br>      &lt;TemperatureInput<br>        scale=&quot;f&quot;<br>        temperature={fahrenheit}<br>        onTemperatureChange={handleFahrenheitChange}<br>      /&gt;<br>    &lt;/div&gt;<br>  );<br>}</pre><pre>export default App;</pre><h3>2. components/TemperatureInput.js</h3><pre>import React from &#39;react&#39;;</pre><pre>const scaleNames = {<br>  c: &#39;Celsius&#39;,<br>  f: &#39;Fahrenheit&#39;,<br>};</pre><pre>function TemperatureInput({ temperature, scale, onTemperatureChange }) {<br>  return (<br>    &lt;fieldset&gt;<br>      &lt;legend&gt;Enter temperature in {scaleNames[scale]}:&lt;/legend&gt;<br>      &lt;input<br>        type=&quot;number&quot;<br>        value={temperature}<br>        onChange={(e) =&gt; onTemperatureChange(e.target.value)}<br>      /&gt;<br>    &lt;/fieldset&gt;<br>  );<br>}</pre><pre>export default TemperatureInput;</pre><h3>3. styles.css (optional styling)</h3><pre>body {<br>  font-family: Arial, sans-serif;<br>  margin: 0;<br>  padding: 2rem;<br>  background-color: #f9f9f9;<br>}</pre><pre>.container {<br>  max-width: 500px;<br>  margin: 0 auto;<br>  background: white;<br>  padding: 2rem;<br>  border-radius: 8px;<br>  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);<br>}</pre><pre>input {<br>  padding: 0.5rem;<br>  font-size: 1rem;<br>  width: 100%;<br>  margin-top: 0.5rem;<br>}</pre><p>Now the <strong>TemperatureConverter</strong> component holds the shared state and passes it down to both inputs. They stay in sync — clean and simple!</p><h3>Benefits of Lifting State Up</h3><ul><li>Keeps your state <strong>centralized</strong> and easy to manage</li><li>Promotes <strong>data consistency</strong> between components</li><li>Encourages reusable and composable component design</li></ul><h3>Common Pitfalls</h3><ul><li>Don’t lift state too high — only to the <strong>nearest common ancestor</strong></li><li>Too much lifting can lead to <strong>bloated parent components</strong></li><li>If the state is deeply shared across many components, consider using <strong>React Context</strong> or external state managers like <strong>Redux</strong> or <strong>Zustand</strong></li></ul><h3>Final Thoughts</h3><p>Lifting state up is a core concept in React that helps keep your data flow predictable and your components in sync. While it might seem tricky at first, it’s one of the cleanest ways to manage shared state without reaching for more complex solutions.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9c632d612f15" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Develop Generative AI solution with Azure OpenAI Service]]></title>
            <link>https://medium.com/@nitishnegi79/develop-generative-ai-solution-with-azure-openai-service-e9e921bd3a5f?source=rss-ca39a6dfbb43------2</link>
            <guid isPermaLink="false">https://medium.com/p/e9e921bd3a5f</guid>
            <dc:creator><![CDATA[Nitish_Negi]]></dc:creator>
            <pubDate>Mon, 26 Feb 2024 08:18:08 GMT</pubDate>
            <atom:updated>2024-02-26T08:18:08.629Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>Introduction:</strong></p><p>Generative AI, often referred to as GenAI, has revolutionized artificial intelligence by enabling machines to autonomously generate human-like content. In this article, we explore the fascinating realm of Generative AI and demonstrate how to harness its potential through the Azure OpenAI Service — a collaboration between Microsoft’s Azure cloud platform and OpenAI.</p><p><strong>What is Generative AI (GenAI):</strong></p><p>Generative AI, a subset of artificial intelligence, focuses on training models to autonomously produce new, original content. These models, such as Generative Pre-trained Transformers (GPT), exhibit a remarkable ability to understand context and generate coherent outputs, making them versatile for various applications.</p><p><strong>What is Azure OpenAI Service:</strong></p><p>Azure OpenAI Service seamlessly integrates the power of GPT models into the Azure ecosystem. This collaborative service simplifies the deployment and management of generative AI solutions, allowing developers to leverage cutting-edge models without the complexities of infrastructure management.</p><p><strong>Getting Started: Setting Up Azure and OpenAI:</strong></p><ol><li><strong>Create an Azure Account:</strong></li></ol><ul><li>Begin by setting up an Azure account, providing access to a range of cloud services.</li><li>Explore key Azure resources such as Virtual Machines and Cognitive Services.</li></ul><p><strong>2. Accessing OpenAI Service:</strong></p><ul><li>Acquire API keys for the OpenAI Service and seamlessly integrate them with your Azure environment.</li></ul><p><strong>Understanding Generative AI Concepts:</strong></p><ol><li><strong>Introduction to GPT Models:</strong></li></ol><ul><li>Delve into the underlying technology of Generative Pre-trained Transformers, understanding their training process and language generation capabilities.</li></ul><p><strong>2. Choosing the Right Model:</strong></p><ul><li>Explore considerations for selecting an appropriate GPT model based on project requirements, considering factors like model size and computational resources.</li></ul><p><strong>Development Steps: Building a Chatbot Example:</strong></p><ol><li><strong>Setting Up the Development Environment:</strong></li></ol><ul><li>Configure your development environment on Azure, utilizing Azure Machine Learning for efficient development.</li></ul><p><strong>2. Data Preparation and Preprocessing:</strong></p><ul><li>Prepare a conversational dataset for training the chatbot, ensuring diversity in topics and responses.</li><li>Sample code for loading and preprocessing conversational data is provided.</li></ul><pre># Sample code for loading and preprocessing conversational data<br>import pandas as pd<br><br># Load dataset<br>conversational_data = pd.read_csv(&#39;conversational_data.csv&#39;)<br><br># Preprocess data<br># (Include tokenization, padding, or any necessary transformations)</pre><p><strong>3. Training the Generative Model:</strong></p><ul><li>Use Azure resources for training the chatbot model.</li><li>Example code demonstrates training the model with Azure Machine Learning services.</li></ul><pre># Sample code for training the chatbot model<br>from azureml.core import Workspace<br>from azureml.train.automl import AutoMLConfig<br><br># Connect to Azure ML Workspace<br>ws = Workspace.from_config()<br><br># Define AutoML configuration for training<br>automl_config = AutoMLConfig(<br>    task=&#39;text-generation&#39;,<br>    primary_metric=&#39;accuracy&#39;,<br>    training_data=conversational_data,<br>    label_column_name=&#39;response&#39;,<br>    max_time_sec=600<br>)<br><br># Submit the training job<br>run = experiment.submit(automl_config)</pre><p><strong>4. Integration with OpenAI Service:</strong></p><ul><li>Integrate the trained chatbot model with Azure OpenAI Service for generating human-like responses.</li><li>Sample code showcases making API requests and handling responses.</li></ul><pre># Sample code for integrating with Azure OpenAI Service<br>import openai<br><br># Set up OpenAI API key<br>openai.api_key = &#39;your_openai_api_key&#39;<br><br># Example prompt for generating chatbot response<br>user_input = &quot;Tell me a joke.&quot;<br><br># Make API request to generate response<br>response = openai.Completion.create(<br>    engine=&quot;text-davinci-003&quot;,<br>    prompt=user_input,<br>    max_tokens=150<br>)<br><br># Extract and display the generated chatbot response<br>chatbot_response = response[&#39;choices&#39;][0][&#39;text&#39;]<br>print(&quot;Chatbot: &quot;, chatbot_response)</pre><p><strong>Optimizing and Fine-Tuning:</strong></p><ol><li><strong>Model Optimization:</strong></li></ol><ul><li>Explore strategies for optimizing the chatbot model’s performance, balancing accuracy and resource efficiency.</li></ul><p><strong>2. Fine-Tuning for Specific Tasks</strong>:</p><ul><li>Discuss options for fine-tuning the model to enhance its performance for specific use cases.</li></ul><p><strong>Deployment and Scaling</strong>:</p><p><strong>Deploying on Azure</strong>:</p><ul><li>Deploy the chatbot on Azure, utilizing services like Azure Functions or Azure Kubernetes Service for scalability.</li></ul><p><strong>Conclusion</strong>:</p><p>In conclusion, developing generative AI solutions with Azure OpenAI Service opens up a world of possibilities. This guide has provided insights into the fundamentals of generative AI, the capabilities of GPT models, and practical steps for developing a chatbot using Azure resources. As technology continues to advance, the collaboration between Azure and OpenAI remains at the forefront of innovation, empowering developers to create intelligent and contextually aware applications. Embrace the power of Generative AI on Azure for your next groundbreaking project.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e9e921bd3a5f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Calculations in Tableau]]></title>
            <link>https://medium.com/@nitishnegi79/calculations-in-tableau-9f5c1c15fc03?source=rss-ca39a6dfbb43------2</link>
            <guid isPermaLink="false">https://medium.com/p/9f5c1c15fc03</guid>
            <dc:creator><![CDATA[Nitish_Negi]]></dc:creator>
            <pubDate>Tue, 23 Jan 2024 10:11:34 GMT</pubDate>
            <atom:updated>2024-01-23T10:11:34.001Z</atom:updated>
            <content:encoded><![CDATA[<h4>This article describes how to create and use calculated fields in Tableau using an example.</h4><p>You’ll learn Tableau calculation concepts, as well as how to create and edit a calculated field. You will also learn how to work with the calculation editor, and use a calculated field in the view.</p><p>If you’re new to Tableau calculations or to creating calculated fields in Tableau, this is a good place to start.</p><h3>Why Use Calculated Fields</h3><p>Calculated fields allow you to create new data from data that already exists in your data source. When you create a calculated field, you are essentially creating a new field (or column) in your data source, the values or members of which are determined by a calculation that you control. This new calculated field is saved to your data source in Tableau, and can be used to create more robust visualizations. But don’t worry: your original data remains untouched.</p><p>You can use calculated fields for many, many reasons. Some examples might include:</p><ul><li>To segment data</li><li>To convert the data type of a field, such as converting a string to a date.</li><li>To aggregate data</li><li>To filter results</li><li>To calculate ratios</li></ul><h3>Types of calculations</h3><p>You create calculated fields using calculations. There are three main types of calculations you can use to create calculated fields in Tableau:</p><ul><li><strong>Basic calculations</strong> — Basic calculations allow you to transform values or members at the data source level of detail (a row-level calculation) or at the visualization level of detail (an aggregate calculation).</li><li><strong>Level of Detail (LOD) expressions</strong> — Just like basic calculations, LOD calculations allow you to compute values at the data source level and the visualization level. However, LOD calculations give you even more control on the level of granularity you want to compute. They can be performed at a more granular level (INCLUDE), a less granular level (EXCLUDE), or an entirely independent level (FIXED) with respect to the granularity of the visualization.</li><li><strong>Table calculations</strong> — Table calculations allow you to transform values at the level of detail of the visualization only.</li></ul><h3>Create a calculated field</h3><p>Once you have determined the type of calculation you want to use, it’s time to create a calculated field. This example uses a basic calculation.</p><p><strong>Note</strong>: The example in this article uses the <strong>Sample-Superstore</strong> data source that comes with Tableau Desktop. To follow along with the steps in this article, connect to the <strong>Sample-Superstore</strong> saved data source and navigate to <strong>Sheet 1</strong>.</p><ol><li>In Tableau, select <strong>Analysis</strong> &gt; <strong>Create Calculated Field</strong>.</li><li>In the Calculation Editor that opens, do the following:</li></ol><ul><li>Enter a name for the calculated field. In this example, the field is called, <strong>Discount Ratio</strong>.</li><li>Enter a formula. This example uses the following formula:</li><li>IIF([Sales] !=0, [Discount]/[Sales],0)</li><li>This formula checks if sales is not equal to zero. If true, it returns the discount ratio (Discount/Sales); if false, it returns zero.</li></ul><ol><li><strong>Tip</strong>: To see a list of available functions, click the triangle icon on the right-side of the Calculation Editor.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/929/0*Gh-2Dt8kPSBMgLCF.png" /></figure><p>Each function includes syntax, a description, and an example for your reference. Double-click a function in the list to add it to the formula.</p><p>3. When finished, click <strong>OK</strong>. The new calculated field is added to Data pane as a measure because it returns a number. An equal sign (=) appears next to the data type icon. All calculated fields have equal signs (=) next to them in the <strong>Data</strong> pane.</p><h3>Use a calculated field in the view</h3><h3>Step 1: Build the view</h3><ol><li>From the <strong>Data</strong> pane, drag <strong>Region </strong>to the <strong>Columns </strong>shelf.</li><li>From the <strong>Data</strong> pane, drag <strong>Category </strong>to the <strong>Rows </strong>shelf.</li><li>On the <strong>Rows </strong>shelf, click the plus icon (<strong>+</strong>) on the <strong>Category </strong>field to drill-down to Subcategory.</li></ol><h3>Step 2: Add the calculated field to the view</h3><ol><li>From the <strong>Data</strong> pane, drag <strong>Discount Ratio</strong> to <strong>Color </strong>on the Marks card. The view updates to highlight table.</li></ol><ul><li>Binders are heavily discounted in the Central region. Notice that Discount Ratio is automatically aggregated as a sum.</li></ul><p>2. On the Rows shelf, right-click <strong>SUM(Discount Ratio)</strong> and select <strong>Measure (Sum)</strong> &gt; <strong>Average</strong>. The view updates to show the average of discount ratio.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*JL5xV2fQ-A9l0EZo.png" /></figure><h3>Edit a Calculated Field</h3><p>If at any time you need to change a calculation, you can edit the calculated field and it will update across your entire workbook.</p><p>To edit a calculated field:</p><ol><li>In the <strong>Data</strong> pane, right-click the calculated field and select <strong>Edit</strong>.</li><li>In the Calculation Editor that opens, you can do the following:</li></ol><ul><li>Edit the name of the calculated field.</li><li>Update the formula.</li></ul><p>For this example, the formula is changed to return a discount ratio for orders over 2000 USD in sales:</p><ul><li>IIF([Sales] &gt; 2000, [Discount]/[Sales],0)</li></ul><p>3. Click <strong>OK</strong>.<br>The view updates to reflect the changes automatically. You <em>do not</em> need to re-add the updated calculated field to the view.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*Hg_DFUgbxa8-dhtM.png" /></figure><h3>Thank You</h3><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9f5c1c15fc03" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to Build an Accordion Menu in React from Scratch — No External Libraries Required]]></title>
            <link>https://medium.com/@nitishnegi79/how-to-build-an-accordion-menu-in-react-from-scratch-no-external-libraries-required-2afd19034fac?source=rss-ca39a6dfbb43------2</link>
            <guid isPermaLink="false">https://medium.com/p/2afd19034fac</guid>
            <dc:creator><![CDATA[Nitish_Negi]]></dc:creator>
            <pubDate>Mon, 02 Jan 2023 10:30:20 GMT</pubDate>
            <atom:updated>2023-01-03T06:04:06.948Z</atom:updated>
            <content:encoded><![CDATA[<h3>How to Build an Accordion Menu in React from Scratch — No External Libraries Required</h3><p>There are many ways to use accordion menus, like displaying a list of FAQs, showing various menus and submenus, displaying the locations of a particular company, and so on.</p><p>So let’s get started.</p><h3>Initial Project Setup</h3><p>Create a new project using create-react-app</p><pre>npx create-react-app react-accordion-demo</pre><p>Once the project is created, delete all files from the src folder and create index.js, App.js, and styles.css files inside the src folder. Also, create a new folder with the name utils inside the src folder.</p><h3>How to Create the Initial Pages</h3><p>Open the src/App.js file and add the following content inside it:</p><pre>import React from &#39;react&#39;;</pre><pre>const App = () =&gt; {<br>  const accordionData = {<br>    title: &#39;Section 1&#39;,<br>    content: `Lorem ipsum dolor, sit amet consectetur adipisicing elit. Quis sapiente<br>      laborum cupiditate possimus labore, hic temporibus velit dicta earum<br>      suscipit commodi eum enim atque at? Et perspiciatis dolore iure<br>      voluptatem.`<br>  };</pre><pre>  const { title, content } = accordionData;</pre><pre>  return (<br>    &lt;React.Fragment&gt;<br>      &lt;h1&gt;React Accordion Demo&lt;/h1&gt;<br>      &lt;div className=&quot;accordion&quot;&gt;<br>        &lt;div className=&quot;accordion-item&quot;&gt;<br>          &lt;div className=&quot;accordion-title&quot;&gt;<br>            &lt;div&gt;{title}&lt;/div&gt;<br>            &lt;div&gt;+&lt;/div&gt;<br>          &lt;/div&gt;<br>          &lt;div className=&quot;accordion-content&quot;&gt;{content}&lt;/div&gt;<br>        &lt;/div&gt;<br>      &lt;/div&gt;<br>    &lt;/React.Fragment&gt;<br>  );<br>};</pre><pre>export default App;</pre><p>Here, we use the accordionData object properties to display the accordion content.</p><p>For the content property we use ES6 template literal syntax (``) so we can spread the content across multiple lines, and we&#39;ve used some dummy lorem ipsum text.</p><p>Now, open the src/index.js file and add the following content inside it:</p><pre>import React from &#39;react&#39;;<br>import ReactDOM from &#39;react-dom&#39;;<br>import App from &#39;./App&#39;;<br>import &#39;./styles.css&#39;;</pre><pre>ReactDOM.render(&lt;App /&gt;, document.getElementById(&#39;root&#39;));</pre><p>Now, if you run the application using the yarn start command from the terminal, you will see the following screen:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*Nohx5mWwTOmBtvOF.png" /></figure><h3>How to Open and Close the Accordion Menu</h3><p>As you can see above, we display a single section as a part of the accordion. But by default, the accordion is expanded and we can’t close it. So let’s add functionality to open and close the accordion.</p><p>Add a new state inside the component as shown below:</p><pre>const [isActive, setIsActive] = useState(false);</pre><p>Here, we’ve defined the isActive state. Based on that, we&#39;ll hide or show the accordion content.</p><p>Also import the useState hook at the top of the file:</p><pre>import React, { useState } from &#39;react&#39;;</pre><p>Now, for the div with class accordion-title, add the onClick handler like this:</p><pre>&lt;div className=&quot;accordion&quot;&gt;<br>  &lt;div className=&quot;accordion-item&quot;&gt;<br>    &lt;div<br>      className=&quot;accordion-title&quot;<br>      onClick={() =&gt; setIsActive(!isActive)}<br>    &gt;<br>      &lt;div&gt;{title}&lt;/div&gt;<br>      &lt;div&gt;{isActive ? &#39;-&#39; : &#39;+&#39;}&lt;/div&gt;<br>    &lt;/div&gt;<br>    {isActive &amp;&amp; &lt;div className=&quot;accordion-content&quot;&gt;{content}&lt;/div&gt;}<br>  &lt;/div&gt;<br>&lt;/div&gt;</pre><p>Here, we’re inverting the isActive state value when we click on the accordion-title div. If the value of isActive is false, we&#39;re setting it to true and vice-versa.</p><p>We’re also showing the + or - sign depending on the value of isActive using the ternary operator.</p><p>And if the isActive state value is true then we&#39;re only showing the accordion content as shown below:</p><pre>{isActive &amp;&amp; &lt;div className=&quot;accordion-content&quot;&gt;{content}&lt;/div&gt;}</pre><p>Now, if you check the application, you will see the following screen:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/706/0*BpxIXxj6p1AOxKBA.gif" /></figure><p>As you can see, initially, the accordion is closed. When we click on the title, the accordion opens and we can click on it again to close it.</p><h3>How to add Multiple Sections in Accordion</h3><p>This works fine for a single section of the accordion. But if we have multiple sections, it will not be good to copy-paste the same JSX code again and again with different content.</p><p>So let’s create a separate component to just display the accordion. Then based on the number of sections, we’ll loop over the component to display multiple sections.</p><p>Create a new Accordion.js file inside the src folder and add the following contents inside it:</p><pre>import React, { useState } from &#39;react&#39;;</pre><pre>const Accordion = ({ title, content }) =&gt; {<br>  const [isActive, setIsActive] = useState(false);</pre><pre>  return (<br>    &lt;div className=&quot;accordion-item&quot;&gt;<br>      &lt;div className=&quot;accordion-title&quot; onClick={() =&gt; setIsActive(!isActive)}&gt;<br>        &lt;div&gt;{title}&lt;/div&gt;<br>        &lt;div&gt;{isActive ? &#39;-&#39; : &#39;+&#39;}&lt;/div&gt;<br>      &lt;/div&gt;<br>      {isActive &amp;&amp; &lt;div className=&quot;accordion-content&quot;&gt;{content}&lt;/div&gt;}<br>    &lt;/div&gt;<br>  );<br>};</pre><pre>export default Accordion;</pre><p>Here, we’ve moved the state and accordion-item div from the App.js file into Accordion.js. We&#39;re passing the dynamic title and content props to the component using ES6 destructuring syntax like this:</p><pre>const Accordion = ({ title, content }) =&gt; {</pre><p>Now, open the App.js file and replace it with the following content:</p><pre>import React from &#39;react&#39;;<br>import Accordion from &#39;./Accordion&#39;;</pre><pre>const App = () =&gt; {<br>  const accordionData = [<br>    {<br>      title: &#39;Section 1&#39;,<br>      content: `Lorem ipsum dolor, sit amet consectetur adipisicing elit. Quis sapiente<br>      laborum cupiditate possimus labore, hic temporibus velit dicta earum<br>      suscipit commodi eum enim atque at? Et perspiciatis dolore iure<br>      voluptatem.`<br>    },<br>    {<br>      title: &#39;Section 2&#39;,<br>      content: `Lorem ipsum, dolor sit amet consectetur adipisicing elit. Mollitia veniam<br>      reprehenderit nam assumenda voluptatem ut. Ipsum eius dicta, officiis<br>      quaerat iure quos dolorum accusantium ducimus in illum vero commodi<br>      pariatur? Impedit autem esse nostrum quasi, fugiat a aut error cumque<br>      quidem maiores doloremque est numquam praesentium eos voluptatem amet!<br>      Repudiandae, mollitia id reprehenderit a ab odit!`<br>    },<br>    {<br>      title: &#39;Section 3&#39;,<br>      content: `Sapiente expedita hic obcaecati, laboriosam similique omnis architecto ducimus magnam accusantium corrupti<br>      quam sint dolore pariatur perspiciatis, necessitatibus rem vel dignissimos<br>      dolor ut sequi minus iste? Quas?`<br>    }<br>  ];</pre><pre>  return (<br>    &lt;div&gt;<br>      &lt;h1&gt;React Accordion Demo&lt;/h1&gt;<br>      &lt;div className=&quot;accordion&quot;&gt;<br>        {accordionData.map(({ title, content }) =&gt; (<br>          &lt;Accordion title={title} content={content} /&gt;<br>        ))}<br>      &lt;/div&gt;<br>    &lt;/div&gt;<br>  );<br>};</pre><pre>export default App;</pre><p>Here, we’ve converted the accordionData from an object to an array of objects. We&#39;re looping over it using the array map method, and passing the corresponding title and content to the Accordion component.</p><p>Now if you check the application, you will see that the three sections get displayed and we can open and close each section as shown below:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/706/0*n4L4cck9GWgEsG15.gif" /></figure><h3>Thank You</h3><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2afd19034fac" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[ReactJS Blueprint Date Picker Component]]></title>
            <link>https://medium.com/@nitishnegi79/reactjs-blueprint-date-picker-component-c1c76e7f2ee2?source=rss-ca39a6dfbb43------2</link>
            <guid isPermaLink="false">https://medium.com/p/c1c76e7f2ee2</guid>
            <dc:creator><![CDATA[Nitish_Negi]]></dc:creator>
            <pubDate>Thu, 03 Nov 2022 05:23:16 GMT</pubDate>
            <atom:updated>2022-11-03T05:23:16.382Z</atom:updated>
            <content:encoded><![CDATA[<h4>Blueprint JS is a React-based UI toolkit for the web. This library is very optimized and popular for building interfaces that are complex data-dense for desktop applications. Date Picker Component helps the user to choose a single date. We can use the following approach in ReactJS to use the ReactJS Blueprint Date Picker Component.</h4><p><strong>Date Picker Props:</strong></p><ul><li><strong>canClearSelection:</strong> It allows the user to clear the selection by clicking the currently selected day.</li><li><strong>className:</strong> It is used to denote a space-delimited list of class names to pass along to a child element.</li><li><strong>clearButtonText:</strong> It is used to denote the text for the reset button in the action bar.</li><li><strong>dayPickerProps:</strong> It is used to denote the props to pass to <em>ReactDayPicker</em>.</li><li><strong>defaultValue:</strong> It is used to denote the initial day of the calendar that will be displayed as selected.</li><li><strong>highlightCurrentDay:</strong> It is used to indicate whether the current day should be highlighted in the calendar.</li><li><strong>initialMonth:</strong> It is used to denote the initial month the calendar displays.</li><li><strong>locale:</strong> It is used to denote the locale name.</li><li><strong>localeUtils:</strong> It is used to denote the collection of functions that provide internationalization support.</li><li><strong>maxDate:</strong> It is used to denote the latest date the user can select.</li><li><strong>minDate:</strong> It is used to denote the earliest date the user can select.</li><li><strong>modifiers:</strong> It is used to denote the collection of functions that determine which modifier classes get applied to which days.</li><li><strong>onChange:</strong> It is a callback function that is triggered when the user selects a day.</li><li><strong>onShortcutChange:</strong> It is a callback function that is triggered when the shortcuts props are enabled and the user changes the shortcut.</li><li><strong>reverseMonthAndYearMenus:</strong> The month menu will appear to the left of the year menu if this is set to true.</li><li><strong>selectedShortcutIndex:</strong> It is used to denote the currently selected shortcut.</li><li><strong>shortcuts:</strong> It is used to indicate whether shortcuts to quickly select a date are displayed or not.</li><li><strong>showActionsBar:</strong> It is used to indicate whether the bottom bar displaying <em>Today</em> and <em>Clear</em> buttons should be shown.</li><li><strong>timePickerProps:</strong> It is used to further configure the <em>TimePicker</em> that appears beneath the calendar.</li><li><strong>timePrecision:</strong> It is used to denote the precision of time selection that accompanies the calendar.</li><li><strong>todayButtonText:</strong> It is used to denote the text for the today button in the action bar.</li><li><strong>value:</strong> It is used to denote the currently selected day.</li></ul><p><strong>DatePickerShortcut Props:</strong></p><ul><li><strong>date:</strong> It is used to denote the date represented by this shortcut.</li><li><strong>includeTime:</strong> It is used to allow this shortcut to change the selected times as well as the dates when this prop is set to true.</li><li><strong>label:</strong> It is used to denote the shortcut label that appears in the list.</li></ul><p><strong>Creating React Application And Installing Module:</strong></p><p><strong>Step 1:</strong> Create a React application using the following command:</p><pre>npx create-react-app foldername</pre><p><strong>Step 2: </strong>After creating your project folder i.e. foldername<strong>, </strong>move to it using the following command:</p><pre>cd foldername</pre><p><strong>Step 3:</strong> After creating the ReactJS application, Install the<strong> </strong>required<strong> </strong>module using the following command:</p><pre>npm install @blueprintjs/core<br>npm install @blueprintjs/datetime</pre><p><strong>Project Structure: </strong>It will look like the following.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/329/0*PXmvbVkU9KrTqNvK.png" /></figure><p><em>Project Structure</em></p><p><strong>Example: </strong>Now write down the following code in the <strong>App.js</strong> file. Here, App is our default component where we have written our code.</p><ul><li>App.js</li></ul><p>import React from &#39;react&#39;</p><p>import &#39;@blueprintjs/datetime/lib/css/blueprint-datetime.css&#39;;</p><p>import &#39;@blueprintjs/core/lib/css/blueprint.css&#39;;</p><p>import { DatePicker } from &quot;@blueprintjs/datetime&quot;;</p><p><strong>function</strong> App() {</p><p><strong>return</strong> (</p><p>&lt;div style={{</p><p>display: &#39;block&#39;, width: 400, padding: 30</p><p>}}&gt;</p><p>&lt;h4&gt;ReactJS Blueprint DatePicker Component&lt;/h4&gt;</p><p>&lt;DatePicker /&gt;</p><p>&lt;/div &gt;</p><p>);</p><p>}</p><p>export <strong>default</strong> App;</p><p><strong>Step to Run Application: </strong>Run the application using the following command from the root directory of the project:</p><pre>npm start</pre><p><strong>Output: </strong>Now open your browser and go to<strong><em> </em></strong><a href="http://localhost:3000/,"><strong><em>http://localhost:3000/</em></strong>,</a> you will see the following output:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/613/0*NHyzRf9SX5DS7kVC.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c1c76e7f2ee2" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>