Make Reusable React Props Streams with Lenses

InstructorJohn Lindquist

Share this video with your friends

Send Tweet

If you hard-code a stream of props to target a specific prop, it becomes impossible to reuse that stream with any other components. Configuring your props stream with lenses will allow you to reuse your stream with any React component.

Stephen James
~ 6 years ago

Your selector function in the typewriter function should probably have a generic name.

      (props, name) => R.set(lens, name, props)

could be

      (props, typedValue) => R.set(lens, typedValue, props)