Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

useLinkPressHandler

// React Router v6 (Native)
// Same as 'useLinkClickHandler' from 'react-router-dom'
// returns a press event handler for custom <Link> navigation.
import { TouchableHighlight } from 'react-native';
import { useLinkPressHandler } from 'react-router-native';

function Link({ onPress, replace = false, state, to, ...rest }) {
  let handlePress = useLinkPressHandler(to, {
    replace,
    state,
  });

  return (
    <TouchableHighlight
      {...rest}
      onPress={e => {
        onPress?.(e);
        !e.defaultPrevented && handlePress(e);
      }}
    />
  );
}
Comment

PREVIOUS NEXT
Code Example
Javascript :: return asynchronous result and not undefined 
Javascript :: node.js sign in to website and get contents of new page 
Javascript :: javascript llenar array con objetos 
Javascript :: how to get all words in a string that exists between two charachters using rejx js 
Javascript :: how to change cursor color in vscode 
Javascript :: create immutable array in javascript 
Javascript :: lement.style { } 
Javascript :: Including soft deleted records 
Javascript :: how to get min value from array of objects in javascript 
Javascript :: ContentDocumentLink example in jS 
Javascript :: errorhandler npm 
Javascript :: data-sap-ui-component-preload-xxx 
Javascript :: react native paper touchable ripple 
Javascript :: foreach doesnt return 
Javascript :: Error: Node Sass version 7.0.1 is incompatible with ^4.0.0. angular 
Javascript :: react computed hook 
Javascript :: array of function 
Javascript :: combine strings in angularjs 
Javascript :: how to load image in hbs document 
Javascript :: how we pass 2 args in switch case javascript 
Javascript :: tekenaja 
Javascript :: on number copy pase formate in reactjs 
Javascript :: code to sum of specific nodes in binary tree for int kDistancefrom node(struct Tree,int k,int n); 
Javascript :: observables loop in template angular 8 
Javascript :: Implicit returns in ES6 
Javascript :: reduce() method executes a reducer function on each element of the array and returns a single output value. 
Javascript :: iteration methods 
Javascript :: Learning Arrow function Syntax 
Javascript :: react native delay input 
Javascript :: how to apply scrollbar in textarea 
ADD CONTENT
Topic
Content
Source link
Name
9+2 =