Skip to content

hook support... #15

@babloo80

Description

@babloo80

Hello there,

I am trying to use react-streams with upcoming hooks from react. And I am seeing some issues.

Here is what I am trying to do...

import React, {useContext} from 'react'
import {streamProps} from 'react-streams'
import {Ctx} from './Ctx'

const Component2 = streamProps( (props$) => {
  const ctx = useContext(Ctx)
  //want to use the ctx along to help transform some stream values of props$
  return props$
})

export default Component2

When the useContext hook is invoked, I get TypeError: dispatcher.useContext is not a function.
Please advice on what alternatives I have?

Thanks,
Muthu

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions