Skip to content

Conversation

@bengry
Copy link
Contributor

@bengry bengry commented Mar 14, 2019

Continuing work done in #83 by @MarcOne68.

Note that this is only a partial replacement for Fabric's pattern:

onRenderText={(props, defaultRenderer) => {
  // no change
  return defaultRenderer(props);

  // props change (support added in this PR)
  return defaultRenderer({ ...props, text: props.text.toUpperCase() });

  // template change (not supported, since we want to abstract away JSX from consumers of `@angular-react`
  // this is supported by passing in a `ComponentRef` or a `TemplateRef`, but then you lose the ability to use `defaultRenderer`.
  return (
    <div style={{ color: 'red' }}>
	  {defaultRenderer(props)}
    </div>
  );
})}

since we still want to abstract away JSX from consumers, and Angular doesn't have first-class support for creating templates in TypeScript.

There are several ways to go about full solutions to this, but they are out of the scope of this PR

@bengry bengry requested review from prjayapa, reshaw and xjerwa March 14, 2019 11:25
Note that this is only a partial replacement for Fabric's pattern,
since we still want to abstract away JSX from consumers,
and Angular doesn't have first-class support for creating templates in TypeScript.
@bengry bengry force-pushed the render-props_allow-transform branch from 06e4c65 to 190e0d6 Compare March 25, 2019 15:39
@bengry bengry added enhancement New feature or request core labels Mar 25, 2019
@bengry bengry merged commit 4bb71a8 into master Mar 25, 2019
@delete-merged-branch delete-merged-branch bot deleted the render-props_allow-transform branch March 25, 2019 15:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

core enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants