gaearon / react-document-title

Declarative, nested, stateful, isomorphic document.title for React
MIT License
1.86k stars 105 forks source link

Not work in iphone wechat #29

Closed tonyzheng121 closed 8 years ago

tonyzheng121 commented 8 years ago

It can not work properly in iphone wechat.

Below is my code.

// routes.jsx
export default (
  <Route>
    <Route path="/" component={ App }>
      <Route path="dailyoperation" component={ DailyOperation } />
    </Route>
    <Route path="/test1" component={ Test1 }/>
    <Route path="/test2" component={ Test2 }/>
    <Route path="/test3" component={ Test3 }/>
  </Route>
);
// Test2.jsx

import React, { Component, PropTypes } from 'react';
import DocumentTitle from 'react-document-title';
import { Link } from 'react-router';

class Test2 extends Component {
  render() {
    return (
      <DocumentTitle title="test2">
      <div>
        test2 <Link to="/test3">test3</Link>
      </div>
      </DocumentTitle>
    );
  }
}

export default Test2;

I test in In iphone5,6 wechat browser, the title does't change when i switch in different page.

gaearon commented 8 years ago

Check out the source code. All we do is set document.title. If it doesn't work for you, it probably means that document.title is not supported in your environment, or that you forgot to add <DocumentTitle> to other route handlers such as Test1 and Test3. This doesn't appear to be an issue with this project.

zhouzefei commented 7 years ago

my version is 2.0.2 i have the same issue. it does not work in iphone , but is ok on android . @gaearon