Documentation

React integration

  1. 1

    Install dependencies

    Make sure you have React v16.8 or higher installed in your project (hooks are required).

  2. 2

    Install @talksprout/react

    Install the @talksprout/react npm package:

    npm i @talksprout/react --save
  3. 3

    Import the component

    Import the talksprout component in the file where you want to use it:

    import React from "react" import { Talksprout } from "./Talksprout"
  4. 4

    Use the component

    Provide the required id and trigger props, and optionally the user prop to attach a logged-in user's email or name to submissions.

    const MyPageComponent = () => { return ( <div> <h1>My Page Component</h1> <Talksprout id="exampleId" trigger={<button>My feedback button!</button>}> {/* Optional: pass a child component as the trigger */} <button>My alternative feedback button!</button> </Talksprout> </div> ) }

    The id should be the workspace ID you want to collect feedback for.

  5. 5

    That's it!

    Run your application and send some feedback through the widget to verify everything is working. Your submissions will appear in the talksprout dashboard.