diff --git a/src/renderers/dom/shared/__tests__/ReactServerRendering-test.js b/src/renderers/dom/shared/__tests__/ReactServerRendering-test.js
index 632f7306c14ea..30d93363b5cb2 100644
--- a/src/renderers/dom/shared/__tests__/ReactServerRendering-test.js
+++ b/src/renderers/dom/shared/__tests__/ReactServerRendering-test.js
@@ -358,6 +358,15 @@ describe('ReactDOMServer', () => {
'Objects are not valid as a React child (found: object with keys {x})',
);
});
+
+ it('should throw prop mapping error for an with invalid props', () => {
+ expect(() =>
+ ReactDOMServer.renderToString(),
+ ).toThrowError(
+ 'The `style` prop expects a mapping from style properties to values, not ' +
+ "a string. For example, style={{marginRight: spacing + 'em'}} when using JSX.",
+ );
+ });
});
describe('renderToStaticMarkup', () => {
diff --git a/src/renderers/shared/server/ReactPartialRenderer.js b/src/renderers/shared/server/ReactPartialRenderer.js
index 9f7e41ffd1f45..26ffaef0e3106 100644
--- a/src/renderers/shared/server/ReactPartialRenderer.js
+++ b/src/renderers/shared/server/ReactPartialRenderer.js
@@ -20,6 +20,7 @@ var ReactControlledValuePropTypes = require('ReactControlledValuePropTypes');
var assertValidProps = require('assertValidProps');
var dangerousStyleValue = require('dangerousStyleValue');
+var emptyFunction = require('fbjs/lib/emptyFunction');
var emptyObject = require('fbjs/lib/emptyObject');
var escapeTextContentForBrowser = require('escapeTextContentForBrowser');
var hyphenateStyleName = require('fbjs/lib/hyphenateStyleName');
@@ -29,6 +30,7 @@ var omittedCloseTags = require('omittedCloseTags');
var isCustomComponent = require('isCustomComponent');
var toArray = React.Children.toArray;
+var emptyFunctionThatReturnsNull = emptyFunction.thatReturnsNull;
if (__DEV__) {
var warning = require('fbjs/lib/warning');
@@ -780,7 +782,7 @@ class ReactDOMServerRenderer {
validatePropertiesInDevelopment(tag, props);
}
- assertValidProps(tag, props);
+ assertValidProps(tag, props, emptyFunctionThatReturnsNull);
var out = createOpenTagMarkup(
element.type,