Skip to content

Instantly share code, notes, and snippets.

View Nasirinezhad's full-sized avatar
🌴
On vacation

Mahdi Nasirinezhad

🌴
On vacation
View GitHub Profile
@slavikshen
slavikshen / ReactJS-InnerText.js
Created November 10, 2015 15:37
How to get inner text in React virtual DOM
$(function() {
React.getInnerText = function(obj) {
var buf = '';
if( obj ) {
var type = typeof(obj);
if( type === 'string' || type === 'number' ) {
buf += obj;
} else if( type === 'object' ) {
var children = null;
if( Array.isArray(obj) ) {