Bazzer588

Results 8 comments of Bazzer588

I have a problem with converting this kind of thing to use functional components and the useCallback hook... ``` export class TestForm extends React.Component { onChangeField = (name,value) => {...

Here's the full code - just drop a `` or a `` somewhere on a page Using a React.Component, only the field being editted does a full render ``` import...

Yes my problem is that the in first example (using React.Component) I can create a _onChangeField_ callback which is bound to _this_, and never changes during renders Using the new...

Yes I've tried similar with _useReducer_ and passing _dispatch_ down to the child components - this does seem to work as you get the same _dispatch_ method so it doesn't...

Thanks @sebmarkbage - didn't realise you could pass a function to changeData (As in `const [data, changeData] = useState({});` ) However now I'm worried - in what case would this...

It's very, very different behaviour With a ES6 class I can pass _onChange={this.handleChange}_ to the child component and it does not redraw every time (because it sends the same _handleChange_...

The basic code issue is this bit: ``` // Hack to auto-select iSight camera on Mac (JPEGCam Issue #5, submitted by manuel.gonzalez.noriega) // From: http://www.squidder.com/2009/03/09/trick-auto-select-mac-isight-in-flash/ var cameraIdx:int = -1; for...

Thanks Joseph Will give this a go on Monday