Skip to content

A module that allows use React DevTools for inspection your component hierarchy without React.

Notifications You must be signed in to change notification settings

artifact-project/react-devtools-symbiote

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

React DevTools Symbiote

A module that allows use React DevTools for inspection your component hierarchy without React.
See DEMO

npm i --save-dev react-devtools-symbiote

Usage

import {connect} from 'react-devtools-symbiote';

const symbiote = connect({
	getInitialRoots() {
		return [{
			// VNode
			type: AppClass,
			dom: document.getElementById('app'),
			props: {name: 'MyApp'},
			children: [{
				type: 'div',
				props: {
					className: 'text',
				},
				children: [{
					type: '#', // text node
					children: 'Wow!1',
				}],
			}],
		}];
	},
});

// Update
symbiote.update(vnode);

// Unmount/destroy
symbiote.unmount(vnode);

VNode

interface VNode {
	key?: string;
	ref?: string;
	dom: HTMLElement | Text;
	type: Function | string;
	props: Object;
	children?: string | VNode[];

	setProps?: (newProps: object) => void;
	setState?: (newState: object) => void;
	forceUpdate: () => void;

	_source: Source;
}

interface Source {
	fileName: string;
	lineNumber: number;
}

Development

About

A module that allows use React DevTools for inspection your component hierarchy without React.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published