Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support Stateless Pure Components #9

Closed
muhilham opened this issue Jan 30, 2017 · 5 comments
Closed

Support Stateless Pure Components #9

muhilham opened this issue Jan 30, 2017 · 5 comments

Comments

@muhilham
Copy link

I got this error while implement it on stateless component

Warning: Stateless function components cannot be given refs (See ref "activeComponent" in ProductForm created by StepZilla). Attempts to access this ref will fail.

@newbreedofgeek
Copy link
Owner

Hi @muhilham unfortunately you cannot use stateless pure components due to the fact that StepZilla clones the step components to append a ref so we can provide the jumpToStep() utility method. ref only works when you inherit from React Component (this is why pure components are not supported at the moment).

In future we can enable a config param to disable this behaviour. i.e. disableJumpToStep = true/false

I'll put this as a enhancement and work on it when I have time. Or feel free to fork and send a pull request if you want to give it a go.

@wassimz
Copy link

wassimz commented Feb 13, 2017

@newbreedofgeek
Can we use a wrapped component. I am using the react-validation-mixin to validate the form input an as a setup we need to wrap the component around the selected strategy. It seems that the isValidated() method not applied ??

@newbreedofgeek
Copy link
Owner

@wassimz it should be possible or I can have a look. Can you give me an example code on your StepZilla initialisation (with your wrapper), so I can reproduce the issue and fix.

@newbreedofgeek newbreedofgeek changed the title stateless component error Support Stateless Pure Components Feb 15, 2017
@newbreedofgeek
Copy link
Owner

@wassimz I have created a new issue for your requirement #15

@newbreedofgeek
Copy link
Owner

newbreedofgeek commented Feb 16, 2017

@muhilham I've added support for Pure Components in react-stepzilla v4.2.0. Check out this file for how - https://github.com/newbreedofgeek/react-stepzilla/blob/master/src/examples/Step2.js

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants