on master help sign in
fix: clean up the spreading of props to StatelessComponent
b771fe9Matt Condon (shrugs)
src/bridge/Bridge.js+24−26
@@ -50,11 +50,11 @@ const kInitialPointCursor = kIsStubbed ? Just(0) : Nothing();
50
50
51// the router itself is just a component that renders a specific view
51// the router itself is just a component that renders a specific view
52// depending on the history
52// depending on the history
53−const Router = function(props) {
53+const Router = function() {
54 const history = useHistory();
54 const history = useHistory();
55 const Route = router(history.peek());
55 const Route = router(history.peek());
56
56
57− return <Route {...props} />;
57+ return <Route />;
58};
58};
59
59
60// NB(shrugs): separate component because it needs useHistory
60// NB(shrugs): separate component because it needs useHistory
@@ -90,33 +90,31 @@ const AllProviders = nest([
90 TxnCursorProvider,
90 TxnCursorProvider,
91]);
91]);
92
92
93−class Bridge extends React.Component {
93+function Bridge() {
94− render() {
94+ return (
95− return (
96− <AllProviders
95+ <AllProviders
97− initialRoutes={kInitialRoutes}
96+ initialRoutes={kInitialRoutes}
98− initialNetworkType={kInitialNetworkType}
97+ initialNetworkType={kInitialNetworkType}
99− initialWallet={kInitialWallet}
98+ initialWallet={kInitialWallet}
100− initialMnemonic={kInitialMnemonic}
99+ initialMnemonic={kInitialMnemonic}
101− initialPointCursor={kInitialPointCursor}>
100+ initialPointCursor={kInitialPointCursor}>
102− <Container>
101+ <Container>
103− <Row>
102+ <Row>
104− <VariableWidthColumn>
103+ <VariableWidthColumn>
105− <Header />
104+ <Header />
106
105
107− <Row className={'row wrapper'}>
106+ <Row className={'row wrapper'}>
108− <Router />
107+ <Router />
109
108
110− <div className={'push'} />
109+ <div className={'push'} />
111− </Row>
110+ </Row>
112
111
113− <Footer />
112+ <Footer />
114− </VariableWidthColumn>
113+ </VariableWidthColumn>
115− </Row>
114+ </Row>
116− </Container>
115+ </Container>
117− </AllProviders>
116+ </AllProviders>
118− );
117+ );
119− }
120}
118}
121
119
122export default Bridge;
120export default Bridge;
src/bridge/views/AcceptTransfer.js−3
@@ -108,9 +108,6 @@ class AcceptTransfer extends React.Component {
108 </Anchor>
108 </Anchor>
109
109
110 <StatelessTransaction
110 <StatelessTransaction
111− // Upper scope
112− {...props}
113− // Other
114 canGenerate={canGenerate}
111 canGenerate={canGenerate}
115 createUnsignedTxn={this.createUnsignedTxn}
112 createUnsignedTxn={this.createUnsignedTxn}
116 ref={this.statelessRef}
113 ref={this.statelessRef}
src/bridge/views/CancelTransfer.js−3
@@ -65,9 +65,6 @@ class CancelTransfer extends React.Component {
65
65
66 <P>{`This action will cancel the transfer to ${proxy}.`}</P>
66 <P>{`This action will cancel the transfer to ${proxy}.`}</P>
67 <StatelessTransaction
67 <StatelessTransaction
68− // Upper scope
69− {...props}
70− // Other
71 canGenerate={canGenerate}
68 canGenerate={canGenerate}
72 createUnsignedTxn={this.createUnsignedTxn}
69 createUnsignedTxn={this.createUnsignedTxn}
73 />
70 />
src/bridge/views/CreateGalaxy.js−3
@@ -183,9 +183,6 @@ class CreateGalaxy extends React.Component {
183 </Button>
183 </Button>
184
184
185 <StatelessTransaction
185 <StatelessTransaction
186− // Upper scope
187− {...props}
188− // Other
189 ref={this.statelessRef}
186 ref={this.statelessRef}
190 canGenerate={canGenerate}
187 canGenerate={canGenerate}
191 createUnsignedTxn={this.createUnsignedTxn}
188 createUnsignedTxn={this.createUnsignedTxn}
src/bridge/views/InvitesManage.js−3
@@ -172,9 +172,6 @@ class InvitesManage extends React.Component {
172 </Input>
172 </Input>
173
173
174 <StatelessTransaction
174 <StatelessTransaction
175− // Upper scope
176− {...this.props}
177− // Other
178 canGenerate={this.state.canGenerate}
175 canGenerate={this.state.canGenerate}
179 createUnsignedTxn={this.createUnsignedTxn}
176 createUnsignedTxn={this.createUnsignedTxn}
180 ref={this.statelessRef}
177 ref={this.statelessRef}
src/bridge/views/IssueChild.js−3
@@ -243,9 +243,6 @@ class IssueChild extends React.Component {
243 </Anchor>
243 </Anchor>
244
244
245 <StatelessTransaction
245 <StatelessTransaction
246− // Upper scope
247− {...props}
248− // Other
249 canGenerate={canGenerate}
246 canGenerate={canGenerate}
250 createUnsignedTxn={this.createUnsignedTxn}
247 createUnsignedTxn={this.createUnsignedTxn}
251 ref={this.statelessRef}
248 ref={this.statelessRef}
src/bridge/views/SetProxy.js−3
@@ -157,9 +157,6 @@ class _SetProxy extends React.Component {
157 {addressInput}
157 {addressInput}
158
158
159 <StatelessTransaction
159 <StatelessTransaction
160− // Upper scope
161− {...props}
162− // Other
163 ref={this.statelessRef}
160 ref={this.statelessRef}
164 createUnsignedTxn={this.createUnsignedTxn}
161 createUnsignedTxn={this.createUnsignedTxn}
165 canGenerate={canGenerate}
162 canGenerate={canGenerate}