Skip to content

Conversation

@leopoldjoy
Copy link

Hello,

When I try to use react-typewriter stamps in my stack that pre-renders the React on the server-side, I get the following error:

TypeError: Cannot read property 'update' of undefined
[1]     at e (/Users/user/myapp/node_modules/react-typewriter/build/react-typewriter.js:1:4647)
[1]     at t (/Users/user/myapp/node_modules/react-typewriter/build/react-typewriter.js:1:4802)
[1]     at mapSingleChildIntoContext (/Users/user/myapp/node_modules/react/lib/ReactChildren.js:105:26)
[1]     at traverseAllChildrenImpl (/Users/user/myapp/node_modules/react/lib/traverseAllChildren.js:98:5)
[1]     at traverseAllChildrenImpl (/Users/user/myapp/node_modules/react/lib/traverseAllChildren.js:114:23)
[1]     at traverseAllChildren (/Users/user/myapp/node_modules/react/lib/traverseAllChildren.js:186:10)
[1]     at mapIntoWithKeyPrefixInternal (/Users/user/myapp/node_modules/react/lib/ReactChildren.js:125:3)
[1]     at Object.mapChildren [as map] (/Users/user/myapp/node_modules/react/lib/ReactChildren.js:145:3)
[1]     at e (/Users/user/myapp/node_modules/react-typewriter/build/react-typewriter.js:1:4714)
[1]     at /Users/user/myapp/node_modules/react-typewriter/build/react-typewriter.js:1:5103

I resolved this error by changing line 22 in src/utils.js from React.addons.update(style || {}, {$merge: _styles}) to Object.assign(style || {}, _styles) as it seemed that React.addons was undefined and pre-rendering and using Object.assign avoided this issue altogether.

markelog added a commit to markelog/react-typewriter that referenced this pull request Dec 30, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant