question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

RFC: Node attrs passed as props in ReactNodeView?

See original GitHub issue

Hey @ifiokjr, what do you think about passing node attrs as props to ReactNodeView? The reason I think we should is because we pass node attrs as props when using an SSRComponent.

Right now, if we try to use the same component for a ReactNodeView and SSRComponent then we get the props two different ways.

Here is the current render function of ReactNodeView:

  public render(props: GProps, forwardRef?: (node: HTMLElement) => void): JSX.Element {
    const Component = this.Component;
    return (
      <Component
        view={this.view}
        getPosition={this.getPosition}
        node={this.node}
        forwardRef={forwardRef}
        {...props}
      />
    );
  }

We can get the node props within the Component render by looking at node.

But when we render with SSR, the attrs are passed as props, however we do not have the node passed as a prop during SSR.

My goal here is to be able to use the same component for ReactNodeView and SSRComponent, as much as possible.

What do you think about passing the node attrs as props in ReactNodeView?

(One argument against it might be that we should be using separate components for these two “separate” uses.)

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:1
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
jashmenncommented, Jul 6, 2019

I’ll take a stab at it

On Sat, Jul 6, 2019 at 9:43 AM Ifiok Jr. notifications@github.com wrote:

Oh yes, @jashmenn https://github.com/jashmenn that’s a great idea. Let’s make it happen.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/ifiokjr/remirror/issues/97?email_source=notifications&email_token=AAABBXQL4BQFHXYUASDX4M3P6CVRXA5CNFSM4H6TO6BKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODZK23CQ#issuecomment-508931466, or mute the thread https://github.com/notifications/unsubscribe-auth/AAABBXVRDGYOLHVDNF5JPS3P6CVRXANCNFSM4H6TO6BA .

– Nate Murray (661) 607-8789 http://eigenjoy.com @eigenjoy

Read more comments on GitHub >

github_iconTop Results From Across the Web

RFC: Plan for custom element attributes/properties in React 19 ...
When React components pass data to one another they already use properties. This would just make custom elements behave the same way. Cons....
Read more >
Vue 3 passing array warning: Extraneous non-props attributes ...
Well I think the error message is pretty clear. Your ItemProperties.vue component is rendering fragments - because it is rendering multiple <div> elements ......
Read more >
RFC: 'Node views' to manage the representation of nodes
When a node view is created, it is passed an action-sending function that it can use to find out its current position in...
Read more >
How React Props relate to HTML attributes and JS functions
A brief 101 introduction to props, through the lens of how props shares similarities with two other fundamental frontend concepts you should ...
Read more >
node-rfc - npm
Asynchronous, non-blocking SAP NetWeaver RFC SDK client bindings for Node.js, providing convenient ABAP business logic consumption from Node.js.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found