Security News
Input Validation Vulnerabilities Dominate MITRE's 2024 CWE Top 25 List
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
@hypersprite/toggle-state-rp
Advanced tools
Handles the toggle state for its children
Returned props:
npm install --save @hypersprite/toggle-state-rp
import OpenState from '@hypersprite/toggle-state-rp';
Place child component inside function return and use the parameters.
<OpenState
render={toggleStateRP => (
<DialogMessage
{...toggleStateRP}
otherProp={this.props.otherPropsOne}
/>
)}
/>
This example assumes a dialog component with some buttons inside looking for "toggle" and some handler functions
git clone https://github.com/HyperSprite/toggle-state-rp.git
cd toggle-state-rp
npm install
npm uses the package name for the module directory placement, not the folder name or repo name, even though they are usually the same. Open package.json and check the name, in this case: "name": "@hypersprite/toggle-state-rp",
Assuming you have a flat folder structure:
Run link from inside your working app
npm link ../toggle-state-rp
If you look in node_modules, you will now see a directory called @hypersprite
with a sub directory toggle-state-rp
You can use your local version inside your app as if it was a published module
import OpenStateRP from '@hypersprite/toggle-state-rp';
If you run install or update on your working app, you will need to rerun the link command. If you are doing this a lot, you could make an npm script for it in your package.json to run after installs, something like:
package.json
"scripts": {
"localmodules": "npm link ../toggle-state-rp && npm link ../some-other-local-project"
}
This will not work if you need to run sudo to to install npm modules, [see this article here](see this http://justjs.com/posts/npm-link-developing-your-own-npm-modules-without-tears) if you need help fixing that .
Testing provided by Jest, Enzyme and coverage report by Istanbul
npm test
Runs all tests.npm run test:dev
only runs the tests in src in watch mode.The branch must be clean to version and publish
git commit -am 'some totally useful comment'
Next, we need to Version:
Note: An initial publish needs a little setup before
npm version
will work.
// manually build your dst
npm run build
// publish your module
// --access public if this is a scoped module and you want it public
npm publish --access public
// delete dst folder
rm -rf dst
npm version <major | minor | patch>
FAQs
'toggle' state render props controller
The npm package @hypersprite/toggle-state-rp receives a total of 0 weekly downloads. As such, @hypersprite/toggle-state-rp popularity was classified as not popular.
We found that @hypersprite/toggle-state-rp 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
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.
Research
Security News
A threat actor's playbook for exploiting the npm ecosystem was exposed on the dark web, detailing how to build a blockchain-powered botnet.