
Security News
Feross on TBPN: How North Korea Hijacked Axios
Socket CEO Feross Aboukhadijeh breaks down how North Korea hijacked Axios and what it means for the future of software supply chain security.
react-sn-question
Advanced tools
npm run install react-sn-question --save
import React from 'react';
import SNQuestion from 'react-sn-question';
import 'react-sn-question/dist/main.css';
import questions from './questions'
class App extends React.Component {
state = {
questions: questions
}
render() {
const isQuestionCorrect = SNQuestion.isQuestionCorrect(this.state.questions)
return (
<SNQuestion
title={"An animal cell contains:"}
resolutionMessage={`The selected value is ${isQuestionCorrect ? 'correct': 'incorrect'}`}
onChange={(value) => checkNewValue(value)}
disable={isQuestionCorrect}
questions={this.state.questions}
/>
)
}
}
| Prop | Type | Required | Default | Description |
|---|---|---|---|---|
title | string | Yes | The title of the question. | |
resolutionMessage | string | Yes | Message to be displayed at the bottom of the container which represents the status of the question. | |
questions | Array | Yes | Contains the questions data. | |
onChange | function | No | undefined | Fires whenever a button is toggled. |
disable | boolean | No | false | Disables the SNQuestion. |
interface SNQuestion {
title: string,
resolutionMessage: string,
questions: Array<Question>
onChange?: (value: string, answerIndex: number, questionIndex: number) => void,
disable?: bool,
}
interface Question {
id: string,
correct: number,
selected: number,
options: Array<Option>,
}
interface Option {
name: string,
value: string
}
All contributions are welcome.
MIT license @Alvaro Bernal G.
FAQs
A react component to easily create a toggleable question.
We found that react-sn-question demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Socket CEO Feross Aboukhadijeh breaks down how North Korea hijacked Axios and what it means for the future of software supply chain security.

Security News
OpenSSF has issued a high-severity advisory warning open source developers of an active Slack-based campaign using impersonation to deliver malware.

Research
/Security News
Malicious packages published to npm, PyPI, Go Modules, crates.io, and Packagist impersonate developer tooling to fetch staged malware, steal credentials and wallets, and enable remote access.