Unable to import a custom cs class in tsx file - reactjs

In my asp.net core application, I received the following error when I try to import the Actor class which resides in the folder called Models.
Below, I share the folder structure of the project.
Below is the configuration file for typscript:
Any ideas why I should be receiving this error?

You cannot use C# classes in typescript. You have to create classes with similar structure in typescript and then use them. Also you can consider using some tools for generating ts classes from C#. This thead might be helpful as well.

Related

How can I use the Richtext component (Wysiwyg) in my strapi plugin?

I’m building a plugin that will allow users to upload a 3D asset and manage some content about that object in a JSON field. I’d also like to use the Richtext field along with the WYSIWYG component that comes with strapi.
I’m looking for a way to import and configure that component in the React component that I’m building in my plugin.
Is this possible, and if so, are there examples of how I could do this?
This is probably the complete Richtext field built into Strapi: https://github.com/strapi/strapi/tree/main/packages/core/admin/admin/src/content-manager/components/Wysiwyg
I don't think it's available with Strapi's published package, and you cannot find it with their design system.
So I'd recommend looking into an alternative solution like using another WYSIWYG editor package instead.

Base code/folder structure for SharePoint Framework SPFx using React

I am new for SharePoint SPFx and React. I am searching for best practice code structure for SharePoint SPFx development using React. Basically I am looking for the code structure where I can put components, models, services and html files in separate folders.
How to use HTML templates file from folder name templates into component file (.tsx)
I have created new folder name 'common-library' inside root folder 'src' and putting all common/shared code like base configurations, models, services in separate folder which can be used in any webpart and react component.
Base code/folder structure
You can check complete code here.

Office UI Fabric Classes Missing in Sharepoint Framework Project

I'm new to Sharepoint Framework but I used the 'yo #microsoft/sharepoint' command to create a new React/SPFx project. However, in doing so it seems that I don't have access to some of the CSS classes available in OfficeUI Fabric. For example if I try to create a typical grid layout, the ms-Grid-row and ms-Grid-col classes work as expected but the sizing utility classes do not (ms-sm6, ms-lg6). Other fabric classes work as well such as ms-bgColor-neutralLight, ms-font-xl, and ms-fontWeight-semibold ... so a portion of that styling is coming through.
If I add a link reference to the workbench.html file pointing to the CDN of fabric.css I get those classes working again....but that is not a solution since that file is just a temporary file build for testing at compile time.
Is there something else that needs to be done to include fabric.css (or fabric.min.css) in my project?
I am running into the same issue. Yeoman generated SPFX webpart (React) for an on premises instance. Digging into the node module, I found the classes didn't match the documentation. Where the documentation would say to use ms-md6, the css file has ms-u-md6. Seems like all of the layout classes follow this pattern of ms-u- rather than just ms-... Adding the -u to the className is now giving me appropriately sized columns.
The path to the file I found the classes in is: .../node_modules/office-ui-fabric/dist/css/fabric.css (YMMV)

Create an extensible architecture with React

My team is creating the administration panel of a CMS using React, Typescript, TSX and Webpack. Each page of the administration panel has been created as a React component, and each page contains many other child components (one for each section).
The CMS distribution currently includes a bundled version of the javascript needed to run the web app, but not the original TSX files.
Now, we would like to make it possible to the developers using our CMS to extend the web app by
1) Injecting additional sections into the UI using a "slot-fill" approach
2) Possibly even overriding the existing sections rendering a different component in the same place.
<div>
<SidebarComponent />
<Section1Component />
<Section2Component />
// How to inject a possible PluginComponent here?
</div>
From the research we've conducted so far, there seem to be no "official" way to do this, so I'm wondering what would be the best approach in this case.
I am facing the same issue where I need a component from a plugin to interact with a component from another plugin with a hook system. I have a created a small codesanbox with the same approach adapted to your need.
Basically the approach is to create a injectedComponents.js at the root of your plugin that specifies in which plugin and area your component needs to be injected.
Here is ademo
single-spa has some good options in order to achieve this.
Please see if it can be help for you.
Microfrontends
Parcels
I am late to this but
Just create a utility class with registry function, and register each component to the registry (just dictionary of key value pair, where key is a constant and Value is the component). T
Then when you display a component in your base app, get it from the registry using a key. Then once you publish this whole base app as package ( make sure to export the utility registry). A user can register a component with the same name and override the default component.
For communication between totally independant components, you can use and EventEmitter

import Only CakePHP Html Helpers in Custom MVC project

I have an unusual task at hand, I just need to import a specific portion of CakePHP framework in my custom MVC project, i.e HTML helpers.
Can anyone tell me what code libraries from CakePHP do I need to transfer into my project , to do this.
Please note I need only HTML helpers from the CakePHP framework.
Thanks.
Just go to the CakePHP Github repository Helper directory and download them: https://github.com/cakephp/cakephp/tree/master/lib/Cake/View/Helper

Resources