-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Closed
Labels
Area: Native ModulesNeeds: Author FeedbackThe issue/PR needs activity from its author (label drives bot activity)The issue/PR needs activity from its author (label drives bot activity)no-recent-activityIssue/PR has gone stale and may be closed (label applied by bot)Issue/PR has gone stale and may be closed (label applied by bot)question
Description
Microsoft.Reactnative exposes interface IViewManager which only works with Frameworkelement. Also there are no shadow nodes in current 0.63 version. I have codebase which is from 0.59-legacy version but now i want to create custom native component in CS using HyperlinkButton and TextBlock. Here is my component class from 0.59-legacy how can i convert below snippet in 0.63 version.
public class ReactHyperlinkButtonViewManager : BaseControlViewManager<HyperlinkButton, ReactSimpleTextShadowNode>
{
public override string Name => "RCTHyperlinkButtonView";
protected override HyperlinkButton CreateViewInstance(ThemedReactContext reactContext)
{
var view = new HyperlinkButton();
view.Content = new TextBlock();
return view;
}
protected override void AddEventEmitters(ThemedReactContext reactContext, HyperlinkButton view)
{
}
public override void OnDropViewInstance(ThemedReactContext reactContext, HyperlinkButton view)
{
}
private void OnPointerEntered(object sender, RoutedEventArgs e)
{
}
private void OnPointerExited(object sender, RoutedEventArgs e)
{
}
private void OnClick(object sender, RoutedEventArgs e)
{
}
private void OnBlur(object sender, RoutedEventArgs e)
{
}
private void OnFocus(object sender, RoutedEventArgs e)
{
}
public override ReactSimpleTextShadowNode CreateShadowNodeInstance()
{
return new ReactSimpleTextShadowNode();
}
public override void UpdateExtraData(HyperlinkButton view, object extraData)
{
var textNode = extraData as ReactSimpleTextShadowNode;
if (textNode != null)
{
textNode.UpdateTextBlock((TextBlock)view.Content);
}
}
}Metadata
Metadata
Assignees
Labels
Area: Native ModulesNeeds: Author FeedbackThe issue/PR needs activity from its author (label drives bot activity)The issue/PR needs activity from its author (label drives bot activity)no-recent-activityIssue/PR has gone stale and may be closed (label applied by bot)Issue/PR has gone stale and may be closed (label applied by bot)question