andrewhathaway / Winterfell

Generate complex, validated and extendable JSON-based forms in React.
http://winterfell.andrewhathaway.net
MIT License
785 stars 116 forks source link

React.findDOMNode is not a function on Submit #66

Closed aethant closed 8 years ago

aethant commented 8 years ago

Using the example schema provided, a la:

 "action" : {
      "default" : {
        "action" : "SUBMIT",
        "target": "www.google.com",
      },
    },
    "button" : {
      "text" : "Add",
    },

I'm getting the following error when I hit the Submit button:

Uncaught TypeError: React.findDOMNode is not a function(anonymous function) 
@ index.js:116notifyAll 
@ CallbackQueue.js:67close 
@ ReactUpdates.js:60closeAll 
@ Transaction.js:204perform 
@ Transaction.js:151perform 
@ ReactUpdates.js:90flushBatchedUpdates 
@ ReactUpdates.js:173closeAll 
@ Transaction.js:204perform 
@ Transaction.js:151batchedUpdates 
@ ReactDefaultBatchingStrategy.js:63batchedUpdates 
@ ReactUpdates.js:98dispatchEvent 
@ ReactEventListener.js:150

Does this have to do with the switch from React to ReactDOM? I couldn't find an open issue with this here on GH.

Using "react": "^15.2.1", "react-dom": "^15.2.1", on the project in question.

andrewhathaway commented 8 years ago

Hi @aethant. Thanks for pointing this one out, and yes you are correct that this is due to React & ReactDOM. findDOMNode has been moved to ReactDOM. However we can remove the dependancy for Winterfell to have ReactDOM by using the ref callback.

If you have the chance to, a PR to fix this would be very helpful. The following links will be very helpful to fix the issue:

Thanks!