Skip to content
This repository was archived by the owner on Aug 4, 2019. It is now read-only.

TypeError: Cannot read property 'refs' of undefined #10

Open
parker-codes opened this issue Jun 24, 2019 · 1 comment
Open

TypeError: Cannot read property 'refs' of undefined #10

parker-codes opened this issue Jun 24, 2019 · 1 comment

Comments

@parker-codes
Copy link

It doesn't look like the second parameter 'context' is defined. The custom hooks are irrelevant to the issue, but this is how I am using them.

This is my code:

setup(props, context) {
  const message = value("Hello Vue in CodeSandbox!");
  const messageUppercase = computed(() => message.value.toUpperCase());

  useKeypress("j", () => {
    console.log("clicked!");
  });

  useElementKeypress("u", context.refs.elementKeypress, () => {
    console.log("clicked!");
  });

  return { message, messageUppercase };
}
@liximomo
Copy link
Owner

liximomo commented Jun 25, 2019

Upgrade to vue-function-api 2.x.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants