We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I have this little example that compiles fine under Haxe 4.2.5 or less. With Haxe 4.3.1 it complains with:
"expression should be a field or of type State (found Int)" - for model.value in <ValStepper value={model.value} step={model.step} />
model.value
<ValStepper value={model.value} step={model.step} />
#if !macro import coconut.data.*; import coconut.ui.*; import coconut.Ui.hxx; import coco.*; import tink.domspec.*; import haxe.DynamicAccess; import js.html.*; #else import haxe.macro.Context; import haxe.macro.Expr; using tink.MacroApi; #end using tink.CoreApi; import js.Browser.document; import tink.state.Scheduler; class ValStepper extends coconut.ui.View { @:attribute var step:Int = 1; @:controlled var value:Int; function render() <div class="counter"> <button onclick={value -= step}>-</button> <span>{value}</span> <button onclick={value += step}>+</button> </div> ; } class TestModel implements Model { @:observable var step: Int = 5; @:editable var value: Int = 0; @:transition function setStep(v) { return {step: v}; } } class TestView1 extends coconut.ui.View { @:attribute var model: TestModel; function render() { return <> <div> <ValStepper value={model.value} step={model.step} /> </div> <div>{model.value}</div> </>; } } class Main { static var model = new TestModel(); static function main() { Renderer.mount(document.getElementById('app'), hxx(<TestView1 model={model} />)); model.setStep(2); } }
-cp src -D analyzer-optimize -main Main --js bin/test.js --library coconut.vdom --library coconut.ui --library coconut.data --dce full
<body> <div id="app"> </div> <script src="test.js" /> </body>
The text was updated successfully, but these errors were encountered:
No branches or pull requests
I have this little example that compiles fine under Haxe 4.2.5 or less. With Haxe 4.3.1 it complains with:
"expression should be a field or of type State (found Int)" - for
model.value
in<ValStepper value={model.value} step={model.step} />
Main.hx
build.hxml
index.html
The text was updated successfully, but these errors were encountered: