question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Problem with classes and state

See original GitHub issue

Test case: https://codepen.io/daviuchoa/pen/jOWKNZX?editors=1010

Hello, I have a problem here, let’s see,

When I try to pass an object to reef component’s data (state) the object’s methods aren’t recognized.

It is always returning TypeError: "x" is not a function. But if I try to use the “x” function outside the Reef component it works.

If I can help you to solve this you can send me a message. I’m available to for any kind of help

Thanks in advance, Reef is a nice lib.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
cferdinandicommented, Jul 10, 2020

hero has no whoIAm property or argument. That’s a function in the IronMan class.

0reactions
cferdinandicommented, Jul 10, 2020

Yes and no.

Data that lives as part of a Reef component state gets converted into a Proxy, so if you’re using the component’s data property, that should be where the data actually lives.

If you want, though, there’s no reason why you can’t use data from external objects/classes inside your template function. Don’t try to use props for them. Call them directly.

You’ll lose out on reactivity this approach, though, and need to call the render() function explicitly.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Classes of problems
Classes of problems · Finite-state computation · Computable and uncomputable problems · Partially computable problems · Polynomial time and space · Relationships ...
Read more >
Class conflict - Wikipedia
Class conflict, also referred to as class struggle and class warfare, is the political tension and economic antagonism that exists in society because...
Read more >
Why am I seeing so many instantiable classes without state?
I'm seeing a lot of instantiable classes in the C++ and Java world that don't have any state. Some possibile reasons to create...
Read more >
Topic 27 classes and objects, state and behavior
The point of classes is to combine state and behavior. – The draw behavior is closely related to a Point's data. – The...
Read more >
The Trouble with Class | European Journal of Sociology ...
“Class” is a difficult concept. For one thing, it has a variety of meanings. Even ignoring its popular uses (as in “We are...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found