
์ธ์ด ๐ฐ๐ท ํ๊ตญ์ด
์์ํ๊ธฐ
์ฌ์ฉ๋ฒ
Add Comments to Your React App
์ด๊ฒ์ FastComments์ ๊ณต์ React ๋ผ์ด๋ธ๋ฌ๋ฆฌ์ ๋๋ค.
React์ฉ FastComments ๋๊ธ ์์ ฏ
์ ์ฅ์
์์ 
examples ํด๋์์ ๋ค์ํ ์ฌ์ฉ ์ฌ๋ก(๋คํฌ ๋ชจ๋, ํ์ด์ง๋ค์ด์
๋ฑ)์ ๋ํ ์์ ๋ฅผ ์ฐพ์ ์ ์์ต๋๋ค. ๊ฐ ์์ ๋ npm install๋ก ์ค์ ํ๊ณ npm run start๋ก ์์ํ ์ ์์ต๋๋ค.
์ฌ์ฉ๋ฒ 
๋ฉ์ธ ์์ ฏ ์ปดํฌ๋ํธ
The FastCommentsCommentWidget ์ปดํฌ๋ํธ์๋ ๋ผ์ด๋ธ FastComments ๋๊ธ ์์ ฏ์ด ํฌํจ๋์ด ์์ต๋๋ค.
์๋์ "demo"๋ฅผ FastComments ๊ด๋ฆฌ์ ์์ญ์ ์ฌ๊ธฐ์์ ํ์ธ ๊ฐ๋ฅํ ๋น์ ์ "tenantId"๋ก ๋ฐ๊พธ์ธ์.
์์ ฏ์ ๋ง์ ์ต์ ์ ์ง์ํฉ๋๋ค - ์ง์๋๋ ์ค์ ์ src/index.tsx์ FastCommentsCommentWidgetConfig๋ฅผ ์ฐธ์กฐํ์ธ์.
import React, { Component } from 'react'
import {FastCommentsCommentWidget} from 'fastcomments-react'
class Example extends Component {
render() {
return <FastCommentsCommentWidget tenantId="demo" />
}
}
ํ์ฌ ํ์ด์ง ์ ๋ฐ์ดํธ (SPA์ฉ)
๋๊ธ ์ค๋ ๋๊ฐ ์ฐ๊ฒฐ๋ ํ์ด์ง/๊ธฐ์ฌ ์ ๋ณด๋ฅผ ์ ๋ฐ์ดํธํ๋ ค๋ฉด ๊ตฌ์ฑ ๋งค๊ฐ๋ณ์ "urlId"์ "url"์ ์ ๋ฐ์ดํธํด์ผ ํฉ๋๋ค. ์์ ์ ์ค๋ช ์ ์ฌ๊ธฐ๋ฅผ ์ฐธ์กฐํ์ธ์.
๊ณ์ ์ง์ญ (์ฃผ์: EU ๊ณ ๊ฐ)
EU์ ๊ณ์ ๊ฒฝ์ฐ, ํด๋ผ์ด์ธํธ ์์ ฏ์ ์ด๋ ์ง์ญ์ ์๋์ง ์๋ ค์ฃผ์ด์ผ ํฉ๋๋ค. examples/example-eu๋ฅผ ์ฐธ์กฐํ์ธ์;
๊ทธ๋ ์ง ์์ ๊ฒฝ์ฐ region์ ์ ์ํ ํ์๊ฐ ์์ต๋๋ค.
๋๊ธ ์นด์ดํธ ์์ ฏ
The FastCommentsCommentCountWidget ์ปดํฌ๋ํธ์๋ ๋ผ์ด๋ธ FastComments ๋๊ธ ์ ์์ ฏ์ด ํฌํจ๋์ด ์์ต๋๋ค.
์๋์ "demo"๋ฅผ FastComments ๊ด๋ฆฌ์ ์์ญ์ ์ฌ๊ธฐ์์ ํ์ธ ๊ฐ๋ฅํ ๋น์ ์ "tenantId"๋ก ๋ฐ๊พธ์ธ์.
์ง์๋๋ ๊ตฌ์ฑ ์ต์ ์ src/index.tsx์ FastCommentsCommentCountConfig๋ฅผ ์ฐธ์กฐํ์ธ์.
import React, { Component } from 'react'
import {FastCommentsCommentCountWidget} from 'fastcomments-react'
class Example extends Component {
render() {
return <FastCommentsCommentCountWidget tenantId="demo" urlId="https://example.com/some-page-or-id" />
}
}
๋ค์ดํฐ๋ธ
FastComments๋ฅผ ์์ ํ ๋ค์ดํฐ๋ธ๋ก ๊ตฌํํ๋ ค๋ฉด fastcomments-react-native-sdk๋ฅผ ์ฐธ์กฐํ์ธ์.
์น๋ทฐ๋ฅผ ์ฌ์ฉํ๋ ์ด ๋ผ์ด๋ธ๋ฌ๋ฆฌ์ React Native ๋ํผ๋ fastcomments-react-native๋ฅผ ์ฐธ์กฐํ์ธ์.
๋์ ํ์ํ์ ๊ฐ์?
React ๋ผ์ด๋ธ๋ฌ๋ฆฌ์ ๊ด๋ จํ์ฌ ๋ฌธ์ ๊ฐ ๋ฐ์ํ๊ฑฐ๋ ์ง๋ฌธ์ด ์๋ ๊ฒฝ์ฐ, ๋ค์์ ์ด์ฉํด ์ฃผ์ธ์:
๊ธฐ์ฌ
๊ธฐ์ฌ๋ ํ์ํฉ๋๋ค! ๊ธฐ์ฌ ์ง์นจ์ GitHub ์ ์ฅ์๋ฅผ ๋ฐฉ๋ฌธํด ์ฃผ์ธ์.