Events in Next Js

  • When you use events in next js then always convert that component as client component through "use client". event like: onclick, onchange etc.
  • Example:


    "use client"
    import React from 'react'

    const Home = () => {
      return (
        <div>
          Home Page
          <button
            onClick={() => {
              alert("hello")
            }}
          >
            Click me
          </button>
        </div>
      )
    }

    export default Home




No comments:

Post a Comment

Date and Time related aggregation functions ($year, $month, $dayOfMonth, $hour, $minute, $second, $dayOfWeek, $dateToString, $dateSubtract, $dateAdd, $isoWeek, $isoDayOfWeek, $dateTrunc, $dateFromString, $dateToParts, $dateFromParts, $dateDiff, $week)

In this blog post, we will explore Date/Time-related Aggregation Functions in MongoDB. MongoDB provides a robust set of aggregation operator...