Skip to content

Commit

Permalink
feat: add xml debugging (#34)
Browse files Browse the repository at this point in the history
  • Loading branch information
divyanshu013 committed Feb 12, 2019
1 parent abe433e commit 2ae88e3
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import {
TouchableOpacity,
View,
} from 'react-native';
import { DOMParser } from 'xmldom';
import { DOMParser, XMLSerializer } from 'xmldom';
import { KeyboardAwareScrollView } from 'react-native-keyboard-aware-scrollview';
import React from 'react';
import VisibilityDetectingView from './VisibilityDetectingView.js';
Expand Down Expand Up @@ -428,6 +428,7 @@ export default class HyperScreen extends React.Component {
fatalError: this.parseError,
},
});
this.serializer = new XMLSerializer();
this.needsLoad = false;
this.state = {
styles: null,
Expand Down Expand Up @@ -940,6 +941,11 @@ export default class HyperScreen extends React.Component {
doc: newRoot,
});

// in dev mode log the updated xml for debugging purposes
if (__DEV__) {
console.log('Updated XML:', this.serializer.serializeToString(newRoot.documentElement));
}

onEnd && onEnd();
});

Expand Down

0 comments on commit 2ae88e3

Please sign in to comment.