Skip to content

Commit

Permalink
.
Browse files Browse the repository at this point in the history
  • Loading branch information
beyaz committed Feb 18, 2024
1 parent 7f733a5 commit 62f2991
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1830,14 +1830,20 @@ function HandleComponentClientTasks(component)

function DefineComponent(componentDeclaration)
{
const dotNetTypeOfReactComponent = componentDeclaration[DotNetTypeOfReactComponent];
var cacheKeyForComponentDefinitions = componentDeclaration[DotNetTypeOfReactComponent];

const component = ComponentDefinitions[dotNetTypeOfReactComponent];
if (cacheKeyForComponentDefinitions === 'ReactWithDotNet.FunctionalComponent,ReactWithDotNet')
{
cacheKeyForComponentDefinitions = componentDeclaration[DotNetProperties].RenderMethodNameWithToken;
}
const component = ComponentDefinitions[cacheKeyForComponentDefinitions];
if (component)
{
return component;
}

const dotNetTypeOfReactComponent = componentDeclaration[DotNetTypeOfReactComponent];

class NewComponent extends React.Component
{
constructor(props)
Expand Down Expand Up @@ -2021,7 +2027,7 @@ function DefineComponent(componentDeclaration)

NewComponent[DotNetTypeOfReactComponent] = dotNetTypeOfReactComponent;

ComponentDefinitions[dotNetTypeOfReactComponent] = NewComponent;
ComponentDefinitions[cacheKeyForComponentDefinitions] = NewComponent;

NewComponent.displayName = dotNetTypeOfReactComponent.split(',')[0].split('.').pop();
if (NewComponent.displayName === 'FunctionalComponent')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1830,14 +1830,20 @@ function HandleComponentClientTasks(component)

function DefineComponent(componentDeclaration)
{
const dotNetTypeOfReactComponent = componentDeclaration[DotNetTypeOfReactComponent];
var cacheKeyForComponentDefinitions = componentDeclaration[DotNetTypeOfReactComponent];

const component = ComponentDefinitions[dotNetTypeOfReactComponent];
if (cacheKeyForComponentDefinitions === 'ReactWithDotNet.FunctionalComponent,ReactWithDotNet')
{
cacheKeyForComponentDefinitions = componentDeclaration[DotNetProperties].RenderMethodNameWithToken;
}
const component = ComponentDefinitions[cacheKeyForComponentDefinitions];
if (component)
{
return component;
}

const dotNetTypeOfReactComponent = componentDeclaration[DotNetTypeOfReactComponent];

class NewComponent extends React.Component
{
constructor(props)
Expand Down Expand Up @@ -2021,7 +2027,7 @@ function DefineComponent(componentDeclaration)

NewComponent[DotNetTypeOfReactComponent] = dotNetTypeOfReactComponent;

ComponentDefinitions[dotNetTypeOfReactComponent] = NewComponent;
ComponentDefinitions[cacheKeyForComponentDefinitions] = NewComponent;

NewComponent.displayName = dotNetTypeOfReactComponent.split(',')[0].split('.').pop();
if (NewComponent.displayName === 'FunctionalComponent')
Expand Down

0 comments on commit 62f2991

Please sign in to comment.