Rudchyk
3/18/2020 - 3:23 PM

useCustomHook

export default function useCustomHook(props) {
  const { uid } = props;

  const someAction = a => {
    return uid + a;
  };

  return {
    someAction
  };
}
import useCustomHook from "./useCustomHook";

const MyComponent = () => {
  const uid = "0";
  const { someAction } = useCustomHook(uid);

  return (
    <div>
      {someAction("-hello!")}
    </div>
  )
};
 
export default MyComponent;