Skip to content

Conversation

@guardrex
Copy link
Collaborator

@guardrex guardrex commented Aug 24, 2022

Fixes #26798

@mayur-ekbote ... Would you like to take a look at this?

See if this lays out the approach and would've helped with the editable <div>s scenario. I never did find out why Javier said "JSObjectReference." I don't see how IJSObjectReference is relevant. Perhaps, he meant to say DotNetObjectReference. The code for the ListItem2 and CallDotNetExample7 components can be reached via the links below. They're in the dotnet/blazor-samples repo, and the code is pulled into the article from there.

I made the example almost exactly like the preceding list item example, so readers can see these approaches in a SxS format. Because I'm using another list item component named "ListItem," you'll see that I'm renaming the one in the Component instance .NET method helper class section to ListItem1 so that I can have the new example named ListItem2.

Internal Review Topic (links to section)

@guardrex guardrex marked this pull request as ready for review August 25, 2022 10:36
@guardrex
Copy link
Collaborator Author

guardrex commented Aug 26, 2022

@mayur-ekbote ... I'm going to go ahead with this. I'd like to merge general Blazor PRs quickly 🏃 at this time, as I'm regularly placing new .NET 7 content and desire to avoid dreaded 💥 merge conflicts 💥.

I didn't hear back from Javier, but I think when he wrote "JSObjectReference" that he actually meant "DotNetObjectReference," which is what made sense to me from the discussion in the PU issue.

If you have feedback ... any problems that you detect with the new section ... please place them in a comment here. I can patch the new content easily enough at any time. Thanks again for calling out the need for this scenario.

Oh! BTW ... You can look at the PR to review the content. If you wait a little while ... a day or two ... the new content will appear on the live site, but it's going to be in the 7.0 content, so select the doc version selector on the live docs site for 7.0 to find the new section after it goes live. The 7.0 docs will become the default doc set when 7.0 releases later this year. I am interested in back porting it to 6.0, 5.0, and 3.1, so I'm going to make an entry on one of my tracking issues to do that. I should reach it within a couple of weeks but certainly will reach it by the EOY.

@guardrex guardrex merged commit e8ac31d into main Aug 26, 2022
@guardrex guardrex deleted the guardrex/blazor-js-interop branch August 26, 2022 11:55
@mayur-ekbote
Copy link

Sorry I couldn't access some bits (internal to Microsoft I guess). I think it is as per what Javier had suggested. I too think that he meant DotNetObjectReference when he wrote JSObjectReference. I have tried the solution and it works. So as you suggested we can relook at it if unforeseen issues come up.

@guardrex
Copy link
Collaborator Author

Thanks @mayur-ekbote ... sounds good. I'll get it posted back to the earlier versions as soon as I can 🏃‍♂️🏃‍♂️🏃‍♂️🏃‍♂️🏃‍♂️😅.

@ng294
Copy link

ng294 commented Dec 22, 2022 via email

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

Successfully merging this pull request may close these issues.

Add a new JS interop scenario

4 participants