Functional components
See original GitHub issueIs it possible to use avoriaz to test functional components? When I quickly tried it out earlier it gave me an error that the context parameter for the component’s render function was undefined.
If I change the mounting to something like this
new Vue({
components: {
Test: component
},
render (h) {
return h('test', options)
}
})
then I don’t get the error message, but everything in context.props
is undefined, like this.
{
prop1: undefined,
prop2: undefined
}
Issue Analytics
- State:
- Created 6 years ago
- Comments:7 (7 by maintainers)
Top Results From Across the Web
Components and Props - React
Components let you split the UI into independent, reusable pieces, and think about each piece in isolation. This page provides an introduction to...
Read more >Functional Components vs Class Components in React
Functional components are basic JavaScript functions. · Sometimes referred to as “dumb” or “stateless” components as they simply accept data and ...
Read more >ReactJS Functional Components - GeeksforGeeks
Functional components are some of the more common components that will come across while working in React. These are simply JavaScript ...
Read more >React Function Components
React Function Components -- also known as React Functional Components -- are the status quo of writing modern React applications.
Read more >Function Components - React TypeScript Cheatsheets
Function Components. These can be written as normal functions that take a props argument and return a JSX element. // Declaring type of...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Here’s a very simple functional component that I was testing with.
I was mounting it like any other component.
It doesn’t matter if I pass an options object with propsData or not, I always get this error.
Thank you! I’ve tested it and it works fine so far 👍