Skip to content

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

Notifications You must be signed in to change notification settings

silasl/componentpath-react-mixin

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

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

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published