我正在尝试在我的java项目中删除以下警告。我试图排除我在maven repo上发现的其他绑定。但它们都没有奏效。非常感谢任何解决问题的想法。
import React, { Component } from 'react';
import { render } from 'react-dom';
import {
BrowserRouter,
MemoryRouter,
Route,
Switch,
Link
} from 'react-router-dom';
const Root = props =>
<BrowserRouter>
<Route path="/" render={ () =>
<div>
<p>Home</p>
<button
onClick={ props.onOpen }>
Start Wizard
</button>
</div> } />
</BrowserRouter>;
const MemRoot = props =>
<div>
<p>Wizard Home</p>
<button onClick={ props.onClose }>
Finish Wizard
</button>
<p>
<Link to='/bar'>/bar</Link>
</p>
</div>;
const Wizard = ({ onClose }) =>
<MemoryRouter>
<Switch>
<Route path="/bar" render={ () =>
<div>bar <Link to='/'>/</Link></div> } />
<Route exact path="/" render={ () =>
<MemRoot onClose={ onClose }/> } />
</Switch>
</MemoryRouter>;
const App = () =>
<BranchRoute />
class BranchRoute extends Component {
state = { out: false }
handleClose = () => this.setState({ out: true })
handleOpen = () => this.setState({ out: false })
render () {
const { out } = this.state;
return (
<div>
{ out
? <Root onOpen={ this.handleOpen }/>
: <Wizard onClose={ this.handleClose } />
}
</div>
);
}
}
render(<App />, document.getElementById('root'));
答案 0 :(得分:1)
分析您的依赖关系树应该让您朝着正确的方向。如果您使用的是Maven,则命令为mvn dependency:tree
。您可能希望将输出添加到您的问题中以获得进一步的帮助。
答案 1 :(得分:0)
很明显,你有log4j-slf4j-impl-2.7.jar和slf4j-simple-1.7.25.jar,删除其中一个。