I am trying to use addon-links. I tried the exact simple button example listed in the documentation, https://www.npmjs.com/package/@storybook/addon-links. LinkTo react component works fine but when I use linkTo function I get "could not navigate to provided story" error. Can someone please help me with this?
import React from "react";
import { linkTo } from '@storybook/addon-links';
import LinkTo from '@storybook/addon-links/react';
export default {
title: 'Button',
};
export const first = () => (
<button onClick={()=>{
// debugger;
linkTo('Button', 'second')
}}>Go to "Second"</button>
);
export const second = () => (
<button onClick={linkTo('Button', 'first')}>Go to "First"</button>
);