preact#createRef JavaScript Examples

The following examples show how to use preact#createRef. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: Legend.js    From lockdown with Apache License 2.0 6 votes vote down vote up
constructor() {
    super();
    this.state = {
      showDialog: false,
      y: 'bottom',
      x: 'left',
    };
    this.btn = createRef();
    this.onClick = this.onClick.bind(this);
    // ? Add listeners
    this.initBtn = this.initBtn.bind(this);
    // ? Mobile
    this.onTouch = this.onTouch.bind(this);
    this.onTouchEnd = this.onTouchEnd.bind(this);
  }
Example #2
Source File: TimeSlider.js    From lockdown with Apache License 2.0 6 votes vote down vote up
constructor() {
    super();
    this.state = {
      currentDateValue: firstDayDefaultOffset,
      currentPosition: 24.5,
      datePickerPosition: 'left',
      showDatePicker: false,
      currentSelectedDay: '',
      firstDay: '',
      lastDay: '',
      currentSliderRange: [],
      CurrentRange: mobileRange,
    };
    this.dateRef = createRef();
    this.range = createRef();
    this.container = createRef();
    this.onSliderChange = this.onSliderChange.bind(this);
    this.onBtnClick = this.onBtnClick.bind(this);
    this.onChooseDate = this.onChooseDate.bind(this);
    this.calendarWillClose = this.calendarWillClose.bind(this);
    this.closeDatePicker = this.closeDatePicker.bind(this);
    this.submitChanges = this.submitChanges.bind(this);
    this.onPressKey = this.onPressKey.bind(this);
    this.updateDates = this.updateDates.bind(this);
  }
Example #3
Source File: PrivateChat.js    From iris-messenger with MIT License 6 votes vote down vote up
constructor() {
    super();
    this.hashtagChatRef = createRef();
    this.state = {
      sortedMessages: [],
      sortedParticipants: [],
      showParticipants: true,
      stickToBottom: true,
      noLongerParticipant: false
    };
  }
Example #4
Source File: TextNode.js    From iris-messenger with MIT License 5 votes vote down vote up
constructor() {
    super();
    this.ref = createRef();
    this.eventListeners = {};
    this.state = {value: ''};
  }
Example #5
Source File: Profile.js    From iris-messenger with MIT License 5 votes vote down vote up
constructor() {
    super();
    this.followedUsers = new Set();
    this.followers = new Set();
    this.id = "profile";
    this.qrRef = createRef();
  }
Example #6
Source File: HashtagChat.js    From iris-messenger with MIT License 5 votes vote down vote up
constructor() {
    super();
    this.hashtagChatRef = createRef();
    this.participants = {};
    this.state = {sortedParticipants: [], showParticipants: true, stickToBottom: true};
  }