Closed angeltrevinov closed 3 months ago
Mitosis currently only supports getter
s in its useStore
, not setter
s.
What does your code achieve that can't be achieved with just a name
property like this?
This example is part of the Mitosis documentation, if setter is not supported then I think it should be removed from the docs.
@angeltrevinov Thanks for pointing that out. Apologies, that example is indeed inaccurate.
I am interested in helping provide a fix!
Yes
Which generators are impacted?
Reproduction case
https://mitosis.builder.io/playground/?code=JYWwDg9gTgLgBAbzgVwM4FMDKNrrgXzgDMoIQ4AiAAQCNlgAbAE3SgDpgIB6EYHVYKgoBuAFCj0AD0iw4LIgENkDeEWQA7AMYxO6uAFkAngGEykdenUwAFGFJhUASkSi4cTRHWp43hTDwAvCgY2LjWCK5ucAD66gog6ABccADkKQA0kW4A5ujwcQnWzhFRUVxccACqGHAwABZ4vv5wAG4KDMh4wERwGDDpcBD1rADugnjDcHYQYK3tnXDdvXmZpW7lg8NQYzWT8koqcx14ED0p2Ogt6ClZUVB5yFB6TehssfF4AD6fU%2FaobAUvj9zv4rikxKV8Kson04IDrIDirc3C83oC4EFARColDIvhHGJIvcYI89NZbgAeJjAFoAPmRcApdQATLSABLoBgMCADBCowH4ClcFn0taM4DqMDIeCeACSkulAQQ1kulhgzgCtLg1n5HwxcFVVjYMAUUFyMDYbWOjkIVs6St1CUIXFFUSF1LpkQJonwQA
Expected Behaviour
I expect the component to build correctly with a setter function using the following example from the documentation
https://mitosis.builder.io/docs/components/#state
Actual Behaviour
When I build, I get the following parsing error
Additional Information
I was trying to create a computed value using set