Skip to content
New issue

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

First parameter must be of type ... for prop setter ... #6

Open
aike19115 opened this issue Nov 26, 2018 · 0 comments
Open

First parameter must be of type ... for prop setter ... #6

aike19115 opened this issue Nov 26, 2018 · 0 comments

Comments

@aike19115
Copy link

aike19115 commented Nov 26, 2018

Output of react-native info:

Environment:
  OS: Windows 10
  Node: 10.13.0
  Yarn: 1.12.3
  npm: 6.4.1
  Watchman: Not Found
  Xcode: N/A
  Android Studio: Not Found

Packages: (wanted => installed)
  react: 16.3.1 => 16.3.1
  react-native: 0.55.4 => 0.55.4

After installing the plugin and using it as follows:

import WindowsSvg from 'react-native-windows-svg';
<WindowsSvg.Svg height={200} width={200}>
    <WindowsSvg.Path stroke="black" strokeWidth={1} />
</WindowsSvg.Svg>

The following error appears:
aa

Changing in the file ShapeViewManager.cs:

        public void SetStroke(Shape view, uint? iColor)
        {
            ShapeViewModel viewModel = (ShapeViewModel)view.DataContext;
            viewModel.SetValue(ShapeViewModel.StrokeProperty, iColor);
            UpdateShape(view, viewModel, "stroke");
        }

to

        public void SetStroke(Rectangle view, uint? iColor)
        {
            ShapeViewModel viewModel = (ShapeViewModel)view.DataContext;
            viewModel.SetValue(ShapeViewModel.StrokeProperty, iColor);
            UpdateShape(view, viewModel, "stroke");
        }

Gives the error:
bb

Which indicates that Rectangle should be Line:

        public void SetStroke(Line view, uint? iColor)
        {
            ShapeViewModel viewModel = (ShapeViewModel)view.DataContext;
            viewModel.SetValue(ShapeViewModel.StrokeProperty, iColor);
            UpdateShape(view, viewModel, "stroke");
        }

But that gives the original error:
aa

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant