Skip to content

Setting optional props with base expr fails without Some(...) #2034

@Xavientois

Description

@Xavientois

Problem

Adding the following test to /yew-macro/tests/html_macro/component-pass.rs fails tests. This is due to the current implementation of property setting with a base expression.

This test passes if the property is wrapped in a Some, but

              <Container int=1 ..props>
                  <Child int=2 opt_str="hello" ..child_props />
              </Container>

Steps To Reproduce
Steps to reproduce the behavior:
Add the above snippet to line 213 of component-pass.rs

Expected behavior
Test passes and optional string it set in prop

Screenshots
Screen Shot 2021-09-06 at 9 00 22 AM

Environment:

  • Yew version: master
  • Rust version: 1.53.0

Questionnaire

  • I'm interested in fixing this myself but don't know where to start
  • I would like to fix and I have a solution
  • I don't have time to fix this right now, but maybe later

Metadata

Metadata

Assignees

Labels

A-yew-macroArea: The yew-macro cratebugmacroIssues relating to our procedural or declarative macros

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions