Skip to content

Commit

Permalink
Fixes to pr
Browse files Browse the repository at this point in the history
  • Loading branch information
Wojciech Szmidt committed Apr 25, 2023
1 parent db23960 commit cbbe62e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
8 changes: 5 additions & 3 deletions Forte.React.AspNetCore/React/ReactService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -116,11 +116,13 @@ public async Task WriteOutputHtmlToAsync(TextWriter writer, string componentName
writeOutputHtmlToOptions ?? new WriteOutputHtmlToOptions());

using var reader = new StreamReader(await result.Content.ReadAsStreamAsync());
int character;

while ((character = reader.Read()) != -1)
char[] buffer = new char[1024];
int numChars;

while ((numChars = await reader.ReadAsync(buffer, 0, buffer.Length)) != 0)
{
await writer.WriteAsync((char)character);
await writer.WriteAsync(buffer, 0, numChars);
}

await writer.WriteAsync("</div>");
Expand Down
2 changes: 1 addition & 1 deletion Forte.React.AspNetCore/renderToPipeableStream.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ module.exports = (
}

let error;
const bootstrapScriptContent = `(window.${objectToSavePropsName} = window.${nameOfObjectToSaveProps} || {})['${jsonContainerId}'] = ${JSON.stringify(
const bootstrapScriptContent = `(window.${nameOfObjectToSaveProps} = window.${nameOfObjectToSaveProps} || {})['${jsonContainerId}'] = ${JSON.stringify(
props
)};`;

Expand Down

0 comments on commit cbbe62e

Please sign in to comment.