This:

```js
createElement(<div />)
```

doesn't currently give a distinguishable message.

https://stackoverflow.com/questions/51110436/wrapping-provider-in-same-component-throws-element-type-is-invalid-expected-a-s

But we can easily detect it by checking for `$$typeof` and in that case suggest something more concrete (e.g. "Did you accidentally export JSX instead of a component?").
const validatedFactory = createElementWithValidation.bind(null, type);
  validatedFactory.type = type;
  
  if (__DEV__) {
    Object.defineProperty(validatedFactory, 'type', {
      enumerable: false,
      get: function() {
        lowPriorityWarning(
          false,
          'Factory.type is deprecated. Access the class directly ' +
            'before passing it to createFactory.',
        );
        Object.defineProperty(this, 'type', {
          value: type,
        });
        return type;
      },
    });
  }
  return validatedFactory;
}
export function cloneElementWithValidation(element, props, children) {
  const newElement = cloneElement.apply(this, arguments);
  for (let i = 2; i < arguments.length; i++) {
    validateChildKeys(arguments[i], newElement.type);
  }
  validatePropTypes(newElement);
  return newElement;
}