This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { ComponentInterface } from '@stencil/core'; | |
import { extendMethod } from '../lang/extend-method'; | |
/** | |
* Represents a Component that implements a Behavior Modification API. | |
*/ | |
export interface ComponentBase extends ComponentInterface { | |
/** | |
* The main native nativeElement from the component. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { Component } from 'react'; | |
import ReactDOM from 'react-dom'; | |
function syncEvent(node, eventName, newEventHandler) { | |
const eventNameLc = eventName[0].toLowerCase() + eventName.substring(1); | |
const eventStore = node.__events || (node.__events = {}); | |
const oldEventHandler = eventStore[eventNameLc]; | |
// Remove old listener so they don't double up. | |
if (oldEventHandler) { |