Home / Function/ Comment() — react Function Reference

Comment() — react Function Reference

Architecture documentation for the Comment() function in index.js from the react codebase.

Entity Profile

Dependency Diagram

graph TD
  5482c564_1bf1_cb36_3d5e_69e94820fee2["Comment()"]
  15aa6526_39c3_6c20_32e2_4050864fa480["index.js"]
  5482c564_1bf1_cb36_3d5e_69e94820fee2 -->|defined in| 15aa6526_39c3_6c20_32e2_4050864fa480
  style 5482c564_1bf1_cb36_3d5e_69e94820fee2 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

fixtures/eslint-v6/index.js lines 5–24

function Comment({comment, commentSource}) {
  const currentUserID = comment.viewer.id;
  const environment = RelayEnvironment.forUser(currentUserID);
  const commentID = nullthrows(comment.id);
  useEffect(() => {
    const subscription = SubscriptionCounter.subscribeOnce(
      `StoreSubscription_${commentID}`,
      () =>
        StoreSubscription.subscribe(
          environment,
          {
            comment_id: commentID,
          },
          currentUserID,
          commentSource
        )
    );
    return () => subscription.dispose();
  }, [commentID, commentSource, currentUserID, environment]);
}

Domain

Subdomains

Frequently Asked Questions

What does Comment() do?
Comment() is a function in the react codebase, defined in fixtures/eslint-v6/index.js.
Where is Comment() defined?
Comment() is defined in fixtures/eslint-v6/index.js at line 5.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free