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

Grid should also work properly with URL as set from react-router #212

Closed
haxpor opened this issue Mar 11, 2017 · 1 comment · Fixed by #213
Closed

Grid should also work properly with URL as set from react-router #212

haxpor opened this issue Mar 11, 2017 · 1 comment · Fixed by #213

Comments

@haxpor
Copy link
Contributor

haxpor commented Mar 11, 2017

Do you want to request a feature or report a bug (建议还是bug) ?
Request a feature. But it can be regarded as a bug too.

What is the current behavior? (现有状况)
Grid when click will take you to the target URL if you set href. But for the case if such target URL is as part of react-router's URL, then it won't work when you build react into production build. It returns 404.

What is the expected behavior? (应有状况)
It should work the same even such URL is as part of react-router.

Which versions of React-weui, weui, and which OS and device are affected by this issue? (React-weui版本 weui版本 机型和系统)
React-weui: 1.0.3
weui: 1.1.0

@n7best
Copy link
Collaborator

n7best commented Mar 12, 2017

related to #208

haxpor added a commit to haxpor/react-weui that referenced this issue Mar 12, 2017
- provided 'component' property to be able to replace component instead
  of using react-router, more flexible

  example of setting from Grid's data from code to use react-router url is as follows

  const data = [
  {
    icon: <img src="./image.png" alt="image icon"/>,
    label: 'Label',
    component: function(props) {
        const { children, ...others } = props;
        return <Link to="/router-url" {...others}> { children } </Link>;
    }
  },
  ]
n7best added a commit that referenced this issue Mar 13, 2017
Updated ESLint version & rules, then fix code across project, and fixed #212, #208, #176
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants