Package Exports
- react-surveying
- react-surveying/dist/index.es.js
- react-surveying/dist/index.js
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (react-surveying) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
React Surveying
React Surveying is a customizable polling component for React applications that allows users to create and participate in polls with various options.
Installation
You can install the React Poll package using npm or yarn:
npm install react-surveyingor
yarn add react-surveyingimport React from 'react';
import { ReactSurvey } from 'react-surveying';
const question = 'What is your favorite color?';
const answers = [
{ option: 'Red', votes: 0 },
{ option: 'Blue', votes: 0 },
];
const handleVote = (selectedOption) => {
// Handle the vote logic here
};
const customStyles = {
// Customize the styles here
};
const disable = false; // Set to true to disable voting
const YourComponent = () => {
return (
<ReactSurvey
question={question}
answers={answers}
onVote={handleVote}
customStyles={customStyles}
disable={disable}
/>
);
};
export default YourComponent;