🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Book a DemoInstallSign in
Socket

componentpath-react-mixin

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

componentpath-react-mixin

React mixin to add data attribute to component element containing path to source file.

1.0.1
latest
Source
npm
Version published
Weekly downloads
2
-71.43%
Maintainers
1
Weekly downloads
 
Created
Source

componentpath-react-mixin

NPM

React mixin to add data attribute to component element containing path to source file. Very useful for QA and debugging code at runtime, particularly UI issues.

Installation

npm install componentpath-react-mixin

Usage

Require the mixin into your component and pass in the file path using the node '__dirname' variable:

var ComponentPathMixin = require('componentpath-react-mixin')(__dirname);

Then include the mixin as normal:

mixins: [ComponentPathMixin]

You can also pass context into your component path to differentiate between different insatnces of the same component. Just pass a 'componentContext' property into your component:

<ReactElement componentContext="context" />

Release History

0.0.1 Initial release 0.0.2 Created tests 0.0.3 Completed readme 1.0.0 Released to NPM 1.0.1 Added NPM badge to readme

Keywords

react

FAQs

Package last updated on 12 Mar 2016

Did you know?

Socket

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.

Install

Related posts