77 * @flow
88 */
99
10- import type { GenericStyleProp } from '../types' ;
1110import type { ElementRef } from 'react' ;
1211
1312import UIManager from '../exports/UIManager' ;
1413import createDOMProps from '../modules/createDOMProps' ;
1514import { useImperativeHandle , useRef } from 'react' ;
1615
17- function setNativeProps ( node , nativeProps , classList , style , previousStyleRef ) {
16+ function setNativeProps ( node , nativeProps , classList , pointerEvents , style , previousStyleRef ) {
1817 if ( node != null && nativeProps ) {
1918 const domProps = createDOMProps ( null , {
19+ pointerEvents,
2020 ...nativeProps ,
21- classList : [ nativeProps . className , classList ] ,
21+ classList : [ classList , nativeProps . className ] ,
2222 style : [ style , nativeProps . style ]
2323 } ) ;
2424
@@ -45,12 +45,9 @@ function setNativeProps(node, nativeProps, classList, style, previousStyleRef) {
4545 * Adds non-standard methods to the hode element. This is temporarily until an
4646 * API like `ReactNative.measure(hostRef, callback)` is added to React Native.
4747 */
48- export default function usePlatformMethods (
49- hostRef : ElementRef < any > ,
50- classList : Array < boolean | string > ,
51- style : GenericStyleProp < any >
52- ) {
48+ export default function usePlatformMethods ( hostRef : ElementRef < any > , props : Object ) {
5349 const previousStyleRef = useRef ( null ) ;
50+ const { classList, style, pointerEvents } = props ;
5451
5552 useImperativeHandle (
5653 hostRef ,
@@ -61,9 +58,9 @@ export default function usePlatformMethods(
6158 UIManager . measureLayout ( hostNode , relativeToNode , failure , success ) ;
6259 hostNode . measureInWindow = callback => UIManager . measureInWindow ( hostNode , callback ) ;
6360 hostNode . setNativeProps = nativeProps =>
64- setNativeProps ( hostNode , nativeProps , classList , style , previousStyleRef ) ;
61+ setNativeProps ( hostNode , nativeProps , classList , pointerEvents , style , previousStyleRef ) ;
6562 return hostNode ;
6663 } ,
67- [ classList , hostRef , style ]
64+ [ hostRef , classList , pointerEvents , style ]
6865 ) ;
6966}
0 commit comments