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.

Forward arguments in the constructor

See original GitHub issue

Grommet does not work with react-apollo’s server-side rendering because of apollostack/react-apollo#132

Expected Behavior

Grommet should forward props and context to React.Component in the constructor.

  constructor(props, context) {
    super(props, context);
    this._onResize = this._onResize.bind(this);
  }

Actual Behavior

No arguments are forwarded.

  constructor() {
    super();
    this._onResize = this._onResize.bind(this);
  }

Your Environment

  • Grommet version: 0.6.10

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
luisrudgecommented, Aug 11, 2016

Components with no constructor don’t need to forward params

1reaction
voodooattackcommented, Aug 11, 2016

@alansouzati You’re welcome.

Components with no constructor are fine from what I’ve seen.

Read more comments on GitHub >

github_iconTop Results From Across the Web

c++ - Is there a generic way to forward constructor arguments?
Suppose Animal's constructor is modified to Animal( std::string const& name ) , which needs the name to be passed up from the children...
Read more >
Constructor Forwarding - develop - Boost C++ Libraries
Fortunately, most constructors take arguments by value, by const-reference or by rvalue reference. If these limitations are accepted, the forwarding ...
Read more >
std::forward - cppreference.com
This example demonstrates perfect forwarding of the parameter(s) to the argument of the constructor of class T . Also, perfect forwarding of parameter...
Read more >
Beware of Perfect Forwarding Constructors - Michael Park
So let's provide a move constructor as well as a templated constructor which perfectly forwards an argument to initialize our wrapped value.
Read more >
Perfect forwarding arguments in a constructor of a templated ...
All std::forward does is simply forward whatever it gets directly to the consumer, if you pass lvalue, a lvalue will be forwarded, if...
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