<commit_before>"use strict";

import React from "react";
import { InnerSlider } from "./inner-slider";
import json2mq from "json2mq";
import defaultProps from "./default-props";
import { canUseDOM } from "./utils/innerSliderUtils";
const enquire = canUseDOM() && require("enquire.js");

export default class Slider extends React.Component {
  constructor(props) {
    super(props);
    this.state = {
      breakpoint: null
    };
    this._responsiveMediaHandlers = [];
  }

  innerSliderRefHandler = ref => (this.innerSlider = ref);

  media(query, handler) {
    // javascript handler for  css media query
    enquire.register(query, handler);
    this._responsiveMediaHandlers.push({ query, handler });
  }

  // handles responsive breakpoints
  UNSAFE_componentWillMount() {
    // performance monitoring
    //if (process.env.NODE_ENV !== 'production') {
    //const { whyDidYouUpdate } = require('why-did-you-update')
    //whyDidYouUpdate(React)
    //}
    if (this.props.responsive) {
      let breakpoints = this.props.responsive.map(
        breakpt => breakpt.breakpoint
      );<commit_msg>remove UNSAFE_componentWillMount usage in slider.js<commit_after>"use strict";

import React from "react";
import { InnerSlider } from "./inner-slider";
import json2mq from "json2mq";
import defaultProps from "./default-props";
import { canUseDOM } from "./utils/innerSliderUtils";
const enquire = canUseDOM() && require("enquire.js");

export default class Slider extends React.Component {
  constructor(props) {
    super(props);
    this.state = {
      breakpoint: null
    };
    this._responsiveMediaHandlers = [];
  }

  innerSliderRefHandler = ref => (this.innerSlider = ref);

  media(query, handler) {
    // javascript handler for  css media query
    enquire.register(query, handler);
    this._responsiveMediaHandlers.push({ query, handler });
  }

  // handles responsive breakpoints
  componentDidMount() {
    // performance monitoring
    //if (process.env.NODE_ENV !== 'production') {
    //const { whyDidYouUpdate } = require('why-did-you-update')
    //whyDidYouUpdate(React)
    //}
    if (this.props.responsive) {
      let breakpoints = this.props.responsive.map(
        breakpt => breakpt.breakpoint
      );
{'fraction_non_alphanumeric': 0.13092046470062557, 'fraction_numerical': 0.0017873100983020554, 'mean_word_length': 3.460159362549801, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, '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': '1622170', 'n_tokens_mistral': 664, 'n_tokens_neox': 650, 'n_words': 154}