<commit_before>var React = require('react');
var { getAttribute } = require('../utils/svg-util');

module.exports = React.createClass({

  propTypes: {
    clipPathID: React.PropTypes.string.isRequired,
    height: React.PropTypes.number.isRequired,
    url: React.PropTypes.string.isRequired,
    width: React.PropTypes.number.isRequired
  },

  getDefaultProps: function() {
    return {
      clipPathID: '',
      height: 0,
      url: '',
      width: 0
    }
  },

  render: function() {
    // React does not support namespaced attributes. So this:
    var attributes = [
      getAttribute('height', this.props.height),
      getAttribute('width', this.props.width)
    ];
    if (this.props.clipPathID) {
      getAttribute('clip-path', 'url(#' + this.props.clipPathID + ')');
    }
    if (this.props.url) {
      getAttribute('xlink:href', this.props.url);
    }<commit_msg>fixed issue with attributes not being added correctly to image loader<commit_after>var React = require('react');
var { getAttribute } = require('../utils/svg-util');

module.exports = React.createClass({

  propTypes: {
    clipPathID: React.PropTypes.string.isRequired,
    height: React.PropTypes.number.isRequired,
    url: React.PropTypes.string.isRequired,
    width: React.PropTypes.number.isRequired
  },

  getDefaultProps: function() {
    return {
      clipPathID: '',
      height: 0,
      url: '',
      width: 0
    }
  },

  render: function() {
    // React does not support namespaced attributes. So this:
    var attributes = [
      getAttribute('height', this.props.height),
      getAttribute('width', this.props.width)
    ];
    if (this.props.clipPathID) {
      attributes.push(getAttribute('clip-path', 'url(#' + this.props.clipPathID + ')'));
    }
    if (this.props.url) {
      attributes.push(getAttribute('xlink:href', this.props.url));
    }
{'fraction_non_alphanumeric': 0.14838709677419354, 'fraction_numerical': 0.002150537634408602, 'mean_word_length': 3.036876355748373, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4128788', 'n_tokens_mistral': 583, 'n_tokens_neox': 569, 'n_words': 112}