Skip to content

Commit

Permalink
Merge pull request #428 from Giphy/react-components/use-client
Browse files Browse the repository at this point in the history
use client in react components
  • Loading branch information
giannif authored Dec 13, 2023
2 parents f261f9b + 4313749 commit 9af848a
Show file tree
Hide file tree
Showing 13 changed files with 17 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .changeset/soft-timers-wave.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@giphy/react-components': patch
---

add 'use client' in react components so they can be used in Next.js App Router more easily
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
'use client'
import { IGif, IProfileUser } from '@giphy/js-types'
import React from 'react'
import styled from 'styled-components'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
'use client'
import { IGif } from '@giphy/js-types'
import React, { useRef } from 'react'
import styled from 'styled-components'
Expand Down
1 change: 1 addition & 0 deletions packages/react-components/src/components/carousel.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
'use client'
import { gifPaginator, GifsResult } from '@giphy/js-fetch-api'
import { IGif, IUser } from '@giphy/js-types'
import { getGifWidth } from '@giphy/js-util'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
'use client'
import { giphyCharcoal, giphyDarkGrey } from '@giphy/colors'
import type { NonPaginatedGifsResult } from '@giphy/js-fetch-api'
import type { GifID, IGif, IUser } from '@giphy/js-types'
Expand Down
1 change: 1 addition & 0 deletions packages/react-components/src/components/gif.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
'use client'
import { giphyBlue, giphyGreen, giphyPurple, giphyRed, giphyYellow } from '@giphy/colors'
import { IGif, IUser, ImageAllTypes } from '@giphy/js-types'
import { Logger, getAltText, getBestRendition, getGifHeight } from '@giphy/js-util'
Expand Down
1 change: 1 addition & 0 deletions packages/react-components/src/components/grid.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
'use client'
import { gifPaginator, GifsResult } from '@giphy/js-fetch-api'
import { IGif, IUser } from '@giphy/js-types'
import { getGifHeight } from '@giphy/js-util'
Expand Down
1 change: 1 addition & 0 deletions packages/react-components/src/components/loader.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
'use client'
import { giphyBlue, giphyGreen, giphyPurple, giphyRed, giphyYellow } from '@giphy/colors'
import React from 'react'
import styled, { keyframes } from 'styled-components'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
'use client'
import { giphyBlack, giphyCharcoal, giphyWhite } from '@giphy/colors'
import { GifsResult, GiphyFetch, Result, SearchOptions, request } from '@giphy/js-fetch-api'
import { IChannel } from '@giphy/js-types'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
'use client'
import { giphyIndigo, giphyLightGrey } from '@giphy/colors'
import React, { useContext, useEffect, useRef, useState } from 'react'
import useDebounce from 'react-use/lib/useDebounce'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
'use client'
import React, { useContext } from 'react'
import styled from 'styled-components'
import { CssVars, SearchContext } from '../context'
Expand Down
1 change: 1 addition & 0 deletions packages/react-components/src/components/video/index.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
'use client'
import { getGifHeight, Logger } from '@giphy/js-util'
import React, { ComponentProps, ElementType, useCallback, useEffect, useState } from 'react'
import useTimeoutFn from 'react-use/lib/useTimeoutFn'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
'use client'
import React, { useEffect, useRef, useState } from 'react'
import styled from 'styled-components'
import { GifOverlayProps } from '../types'
Expand Down

0 comments on commit 9af848a

Please sign in to comment.